Community
Participate
Working Groups
If some how the CDO server crashes or is killed, it's not possible to re-connect to the Postgres DB, the exception below will occur. Postgres is expecting a rollback. Postgres 8.3 and 8.4 !ENTRY org.eclipse.equinox.app 4 0 2011-12-05 13:46:45.523 !MESSAGE org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block !STACK 0 org.eclipse.net4j.db.DBException: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.ObjectTypeTable.getMaxID(ObjectTypeTable.java:185) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.DelegatingObjectTypeMapper.getMaxID(DelegatingObjectTypeMapper.java:85) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.repairAfterCrash(AbstractHorizontalMappingStrategy.java:88) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy.repairAfterCrash(HorizontalMappingStrategy.java:204) at org.eclipse.emf.cdo.server.internal.db.DBStore.repairAfterCrash(DBStore.java:652) at org.eclipse.emf.cdo.server.internal.db.DBStore.reStart(DBStore.java:636) at org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate(DBStore.java:546) 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:1543) 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.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110) 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)
Stefan, can you have a look what Postgres is messing up here? It seems to be a PITA ;-(
This change to ObjectTypeTable in the method below solved the problem. (Adding autocommit to the connection). I found later versions of Postgres, would handle this error with autocommit. It's propably not the best solution, but at least for me it solved the issue. public CDOID getMaxID(Connection connection, IIDHandler idHandler) { Statement stmt = null; ResultSet resultSet = null; try { stmt = connection.createStatement(); connection.setAutoCommit(true); resultSet = stmt.executeQuery("SELECT MAX(" + idField + ") FROM " + table); connection.setAutoCommit(false); if (resultSet.next()) { return idHandler.getCDOID(resultSet, 1); } return null; } catch (SQLException ex) { throw new DBException(ex); } finally { DBUtil.close(resultSet); DBUtil.close(stmt); } }
Moving all open bug reports to 4.1 because the release is very near and it's hghly unlikely that there will be spare time to address 4.0 problems. Please make sure that your patches can be applied against the master branch and that your problem is not already fixed there!!!
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
(In reply to comment #2) > try > { > stmt = connection.createStatement(); > connection.setAutoCommit(true); Hmm, wouldn't it be better to do this in org.eclipse.emf.cdo.server.internal.db.DBStore.repairAfterCrash()?
This bug and bug 364809 are basically duplicates but they seem to suggest different solutions.
Fixed via bug 364809. *** This bug has been marked as a duplicate of bug 364809 ***
Closing