db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suavi Ali Demir <dem...@yahoo.com>
Subject Re: CREATE FUNCTION with SQL examples ?
Date Sat, 18 Dec 2004 05:30:10 GMT
Ok, my bad. I assumed con.close() would call
rollback() or something. Apparently it does not and
the transaction keeps going. 

In the context of a stored procedure that is executing
though a sql statement that was executed using an
existing connection why would any database not be able
to return a reference to the current connection?

When we call our stored proc, it is running inside the
engine already, it is not a different machine or
anything. It is the connection that is executing the
sql statement that invoked our stored proc. It should
be possible to pass a reference to the current
connection in such cases, no?


--- Daniel John Debrunner <djd@debrunners.com> wrote:
> Hash: SHA1
> Suavi Ali Demir wrote:
> > To clarify: You shoul NOT close the connection
> that
> > you get from the URL jdbc:default:connection. This
> is
> > not a new connection. This is the connection that
> your
> > stored proc or function is running in the context
> of.
> > It was created by the code that is executing the
> sq
> No, that is incorrect.
> It is safe and correct to close the connection
> obtained through the JDBC
> URL jdbc:default:connection. The connection object
> returned is in the
> same transaction space as the calling SQL statement.
> If you think about
> it, a non-embedded database system such Oracle or
> DB2 cannot return a
> reference to the Connection object used by the
> application, because it
> is a different process on possibly a different
> machine.
> - From the SQL spec (part 13)
> default connection: a JDBC connection to the current
> SQL-implementation,
> SQL-session, and SQLtransaction
> established with the data source URL
> 'jdbc:default:connection'.
> Dan.
> Version: GnuPG v1.2.5 (MingW32)
> Comment: Using GnuPG with Mozilla -
> http://enigmail.mozdev.org
> A73i1qX7a9SU7KXtEf1Q2aw=
> =NQfJ

View raw message