db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Does using DerbyDB require synchronization?
Date Tue, 09 Sep 2008 17:50:05 GMT
Mamta Satoor wrote:
> I think if the resultsets are created with held over commit, then
> auto-commit on or off should not matter.
No, held result sets are still affected by commits, just not closed.
After a commit the only allowed action on a held cursor is a next or
a close, other actions may return unexpected errors in the use case
this user is describing.
> 
> Mamta
> 
> On 9/9/08, Knut Anders Hatlen <Knut.Hatlen@sun.com> wrote:
>> 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