| Summary: | [DB] Derby test failing | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Egidijus Vaisnora <vaisegid> | ||||||||
| Component: | cdo.core | Assignee: | Egidijus Vaisnora <vaisegid> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | stefan | ||||||||
| Version: | 4.0 | Flags: | stepper:
review+
|
||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Egidijus Vaisnora
revision 7030 from trunk I guess this is related to Eikes change of the activation process in Bug 336642. Since Derby is one of the few databases which perform restrictive locking when creating or altering tables, this can lead to deadlocks resulting in the mentioned exception. Created attachment 188663 [details]
Patch v1
Exception was thrown on closing DB connection - "transaction in use". While exception was consumed without showing it, it was hard to point problem easily. Problem seems to be that connection was not commited (autocommit == false)
In patch I have enabled logger in order to avoid in future simile bugs, but now starting server second time I got exception. Looking at the code - result set are properly closed... Do I need to make commit or rollback, just to finish transaction? ava.sql.SQLException: Cannot close a connection while a transaction is still active. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.checkForTransactionInProgress(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.close(Unknown Source) at org.eclipse.net4j.db.DBUtil.close(DBUtil.java:183) at org.eclipse.emf.cdo.server.internal.db.DBStore.getPropertyValues(DBStore.java:295) at org.eclipse.emf.cdo.server.internal.db.DBStore.isFirstStart(DBStore.java:569) at org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate(DBStore.java:523) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89) at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1548) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89) at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201) at org.eclipse.emf.cdo.internal.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:96) at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61) at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26) at java.lang.Thread.run(Thread.java:680) Created attachment 188683 [details]
Patch v2
I cannot believe that we need a writer rather than a reader just to make Derby happy. I've not yet run the Derby suite, but isn't the closing of the resultSet already enough?
Maybe you need to szudy the code of org.apache.derby.impl.jdbc.EmbedConnection.checkForTransactionInProgress() ? (In reply to comment #6) > Maybe you need to szudy the code of > org.apache.derby.impl.jdbc.EmbedConnection.checkForTransactionInProgress() ? study ;-) > I cannot believe that we need a writer rather than a reader just to make Derby
> happy. I've not yet run the Derby suite, but isn't the closing of the resultSet
> already enough?
You are creating table "cdo_external_refs" running server for the first time, hence there is a writer. While we can create a table in this connection, then we need to commit transaction. Am I missing here something?
Sorry, I just realized this, now that I executed the Derby tests. Making new patch... Created attachment 188685 [details]
Patch v3 - ready to be committed
Committed to trunk, revision 7052 Available in R20110608-1407 |