db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Does using DerbyDB require synchronization?
Date Tue, 09 Sep 2008 14:23:43 GMT
derbyfan195 <huang195@gmail.com> writes:

> Knut,
>
> Thanks for your response. I'm more interested in not having to establish
> separate connections for each thread as I've noticed establishing connection
> in Derby takes a while, so if I can use the same connection among the
> different threads (with some synchronization), that would be the ideal case
> for me at the moment. 
>
> What puzzles me is that you said when you close a ResultSet on a connection,
> all other ResultSets lose their position. My understanding is that from a
> Connection, you get a Statement, and from a Statement, you get a ResultSet.
> Having multiple ResultSet from the same Statement is troublesome, but I
> thought ResultSets from different Statements should never have conflict with
> each other, i.e., if I close a ResultSet on Statement A, it shouldn't affect
> another ResultSet that's opened on Statement B. Is this understanding not
> correct? 

Yes, I believe this is correct when auto-commit is turned off. When
auto-commit is turned on, closing one ResultSet may affect all
ResultSets in that Connection, even if they were created by different
Statements.

-- 
Knut Anders

Mime
View raw message