Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Potential bug in org.eclipse.net4j.internal.db.DBConnection
[CDO] Potential bug in org.eclipse.net4j.internal.db.DBConnection [message #1277008] Tue, 25 March 2014 10:45 Go to next message
Ashish Shinde is currently offline Ashish ShindeFriend
Messages: 21
Registered: August 2013
Junior Member
Hi,

I am using a weekly build of CDO 4.3 with the db store and in a particular case a commit hangs for a while and then times out.

The sequence of events are
1. I query CDO on a particular eclass before adding any instance for it (valid use case for me and would happen at times). Since the DB store hasn't create a table for my eclass db store throws an exception

'Caused by: org.h2.jdbc.JdbcSQLException: Table "DEFECT" not found; SQL statement'

2. After this on the next add of an instance of the eclass the commit hangs for a while and then times out.


I have verified that in the following code, in org.eclipse.net4j.internal.db.DBConnection, the line with the throw statement exception is the culprit. My guess is database.endSchemaAccess() should be invoked in this case before throwing an exception.

public IDBPreparedStatement prepareStatement(final String sql, final int resultSetType, final int resultSetConcurrency,
final ReuseProbability reuseProbability)
{
database.beginSchemaAccess(false);

DBPreparedStatement preparedStatement;
synchronized (this)
{
preparedStatement = cache.remove(sql);
if (preparedStatement == null)
{
try
{
final PreparedStatement delegate = getDelegate().prepareStatement(sql, resultSetType, resultSetConcurrency);
preparedStatement = new DBPreparedStatement(this, sql, reuseProbability, delegate);
}
catch (final SQLException ex)
{
throw new DBException(ex);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

Adding the encSchemaAccess call solves my problem.

Also in the file org.eclipse.net4j.internal.db.DBDatabase in the function beginSchemaAccess should the schemaAccessQueue.wait() statement be called with a timeout? The block of code is synchronized with schemaAccessQueue, meaning no other thread would be able to enter the synchronized block in endSchemaAccess() and hence will never be able to notify of the lock release.

Thanks and regards,
- Ashish
Re: [CDO] Potential bug in org.eclipse.net4j.internal.db.DBConnection [message #1286949 is a reply to message #1277008] Mon, 07 April 2014 08:18 Go to previous message
Ashish Shinde is currently offline Ashish ShindeFriend
Messages: 21
Registered: August 2013
Junior Member
Any thoughts on this. Should this be filed as a bug report ?


Thanks and regards,
- Ashish
Previous Topic:[Xcore] Accessing a SuppressedGetVisibility feature in operation w/ Xtend
Next Topic:Text generation from GMF Runtime (from diagram)
Goto Forum:
  


Current Time: Fri Apr 19 02:08:43 GMT 2024

Powered by FUDForum. Page generated in 0.01830 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top