Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336932

Summary: [DB] Derby connection is not closed
Product: [Modeling] EMF Reporter: Egidijus Vaisnora <vaisegid>
Component: cdo.dbAssignee: Caspar D. <caspar_d>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: caspar_d, stefan
Version: 4.0Flags: stepper: review+
stepper: review+
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patch v1
none
Patch (incremental)
none
Patch v3 - ready to be committed none

Description Egidijus Vaisnora CLA 2011-02-11 08:09:59 EST
In Derby, each connection before *close* needs to call *committed* or *rollback* always in order to complete transaction, if autocommit is set to false. Now I got exception "Cannot close a connection while a transaction is still active." on running CDO server for the second time, when DB is already created
Even, if transaction executes read statement it must be explicitly *committed* or *rollback*.
http://db.apache.org/derby/docs/10.4/devguide/cdevconcepts29416.html
Comment 1 Egidijus Vaisnora CLA 2011-02-14 04:38:07 EST
Created attachment 188879 [details]
Patch v1

We can always initiate rollback, whenever connections is aranged for closing
Comment 2 Eike Stepper CLA 2011-02-22 06:35:06 EST
Stefan may want to have a look, as well.

Since it'd be easy enough to remove you may commit it now ;-)
Comment 3 Egidijus Vaisnora CLA 2011-02-22 16:07:19 EST
committed to trunk, revision 7178
Comment 4 Caspar D. CLA 2011-02-28 05:48:31 EST
Patch has introduced the opposite problem for connections with
autocommit = true. I.e. they can't be rolled back, but with the
current patch, rollback gets called on them anyway.
Comment 5 Caspar D. CLA 2011-02-28 05:51:09 EST
Created attachment 189925 [details]
Patch (incremental)
Comment 6 Eike Stepper CLA 2011-03-01 02:37:14 EST
Created attachment 190024 [details]
Patch v3 - ready to be committed
Comment 7 Caspar D. CLA 2011-03-01 03:03:34 EST
Committed to trunk, revision 7312.
Comment 8 Eike Stepper CLA 2011-06-23 03:40:09 EDT
Available in R20110608-1407