> -----Original Message----- > From: Amir Michail [mailto:[EMAIL PROTECTED] > Sent: Monday, February 26, 2007 7:16 PM > To: Derby Discussion > Subject: Re: prepared statements > > On 2/26/07, Dag H. Wanvik <[EMAIL PROTECTED]> wrote: > > "Bernt M. Johnsen" <[EMAIL PROTECTED]> writes: > > > > > Hi, > > > > > > > > > This behaviour is defined in the JDBC specification. > > > > But Derby's statement cache works across connections, which alleviates > > redundant statement compilation. > > > > I ran into a connection lost exception and I had no idea why. It > wasn't obvious that this was the reason from the error given. Also, > it's not obvious why you would want to prevent sharing of prepared > statements across connections. > > Amir > > This isn't a derby thing but a *java* thing. As well, it's a database thing.
In fact, think about it from a database perspective. If you could disassociate a prepared statement from the connection, how do you control the prepared statement. Meaning how do you know when you no longer need a prepared statement.
