Posts mit dem Label H2 database werden angezeigt. Alle Posts anzeigen
Posts mit dem Label H2 database werden angezeigt. Alle Posts anzeigen

Freitag, 17. Juli 2009

Eclipse CDO problems with Apache Derby

hi folks,

these days I was having problems with my CDO server:

after inserting some models into a repository, and then restarting the server, I was getting this error:

[ERROR] Rollback in DBStore: org.eclipse.net4j.db.DBException: SQL Exception: A lock could not be obtained within the time requested

First, I thought, I forgot to commit/close a transaction; but this was not the case.
In the emf news group, eike told me, that there was a similar problem in the tests based on apache derby.

So, I switched to H2, and the error did not occur anymore.

I was desperately looking for the net4j H2Adapter in the latest net4j releases but was not able to find it. Finally, I found it here, copied to my workspace, and changed the creation of the IStore:

org.h2.jdbcx.JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setURL("jdbc:h2:~/h2Test");


IDBAdapter dbAdapter = new H2Adapter();


IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true);


IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);



IStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);



cheers,

steven