H2 datastore cannot deal with multiple parallel transactions 
-------------------------------------------------------------

                 Key: GEOT-2832
                 URL: http://jira.codehaus.org/browse/GEOT-2832
             Project: GeoTools
          Issue Type: Bug
          Components: data jdbc-ng
    Affects Versions: 2.6-RC1
            Reporter: Andrea Aime
            Assignee: Justin Deoliveira
             Fix For: 2.6.1


The test added to check that that batch event and transactions do work in 
GEOT-2829 actually shows it's not possible to do anything else while a 
transaction is running, the code that tries to count the rows in the table 
while the transaction is running actually times out very quickly with this 
error:

{code}
java.lang.RuntimeException: java.io.IOException
        at 
org.geotools.data.store.ContentFeatureCollection.size(ContentFeatureCollection.java:282)
        at 
org.geotools.jdbc.JDBCFeatureStoreTest.testAddInTransaction(JDBCFeatureStoreTest.java:122)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at org.geotools.jdbc.JDBCTestSupport.run(JDBCTestSupport.java:104)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.io.IOException
        at 
org.geotools.jdbc.JDBCDataStore.getAggregateValue(JDBCDataStore.java:1109)
        at org.geotools.jdbc.JDBCDataStore.getCount(JDBCDataStore.java:1042)
        at 
org.geotools.jdbc.JDBCFeatureSource.getCountInternal(JDBCFeatureSource.java:405)
        at 
org.geotools.data.store.ContentFeatureSource.getCount(ContentFeatureSource.java:409)
        at 
org.geotools.jdbc.JDBCFeatureStore.getCountInternal(JDBCFeatureStore.java:172)
        at 
org.geotools.data.store.ContentFeatureSource.getCount(ContentFeatureSource.java:409)
        at 
org.geotools.data.store.ContentFeatureCollection.size(ContentFeatureCollection.java:280)
        ... 21 more
Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table ft1; SQL 
statement:
SELECT count(*) FROM "geotools"."ft1" [50200-104]
        at org.h2.message.Message.getSQLException(Message.java:103)
        at org.h2.message.Message.getSQLException(Message.java:114)
        at org.h2.message.Message.getSQLException(Message.java:77)
        at org.h2.table.TableData.doLock(TableData.java:422)
        at org.h2.table.TableData.lock(TableData.java:361)
        at org.h2.table.TableFilter.lock(TableFilter.java:106)
        at org.h2.command.dml.Select.queryWithoutCache(Select.java:548)
        at org.h2.command.dml.Query.query(Query.java:233)
        at org.h2.command.CommandContainer.query(CommandContainer.java:81)
        at org.h2.command.Command.executeQueryLocal(Command.java:141)
        at org.h2.command.Command.executeQuery(Command.java:122)
        at 
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
        at 
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
        at 
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
        at 
org.geotools.jdbc.JDBCDataStore.getAggregateValue(JDBCDataStore.java:1084)
        ... 27 more
{code}

Seems a decently serious error for a database backed datastore (I mean, 
concurrent access management is the reason DBMS exist)

I've commented out that test for the H2 store, the resolution to this jira 
should address the problem and restore the test

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to