Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-users] Connection is closed on line editing and committing

Hi,

 

in August 2013 I reported an error happening to me with uDig 1.3.2 when drawing lines using the standard line drawing tool and committing as soon as drawing is finished (by hitting the commit button immediately after [enter] or double clicking). Jody Garnett remembered that error and thought it was fixed. At that time I was not able to test this behavior with uDig 1.4.0, but now I set up the metadata tables correctly and the error still exists with 1.4.0.

 

If the described procedure (draw-commit-draw-commit) is done multiple times, I get a connection is closed exception from the connection pool before the fifth iteration. Something (renderer) called a connection.close() (on the dbcp connection wrapper) on the EditManager-transaction-connection. After the connection was closed, no more lines can be drawn. The stack trace is:

 

!ENTRY net.refractions.udig.tools.edit 1 0 2014-01-31 14:53:31.610

!MESSAGE

!STACK 0

java.io.IOException

                at org.geotools.jdbc.JDBCFeatureStore.getWriterInternal(JDBCFeatureStore.java:318)

                at org.geotools.data.store.ContentFeatureStore.getWriter(ContentFeatureStore.java:150)

                at org.geotools.data.store.ContentFeatureStore.getWriter(ContentFeatureStore.java:121)

                at org.geotools.data.store.ContentFeatureStore.getWriterAppend(ContentFeatureStore.java:261)

                at org.geotools.data.store.ContentFeatureStore.addFeatures(ContentFeatureStore.java:240)

                at org.geotools.data.SimpleFeatureStoreBridge.addFeatures(SimpleFeatureStoreBridge.java:48)

                at net.refractions.udig.project.internal.impl.UDIGSimpleFeatureStore.addFeatures(UDIGSimpleFeatureStore.java:284)

                at net.refractions.udig.project.internal.commands.edit.AddFeatureCommand.run(AddFeatureCommand.java:88)

                at net.refractions.udig.tools.edit.commands.CreateAndSelectNewFeature.run(CreateAndSelectNewFeature.java:81)

                at net.refractions.udig.project.command.UndoableComposite.execute(UndoableComposite.java:82)

                at net.refractions.udig.tools.edit.BehaviourCommand.execute(BehaviourCommand.java:60)

                at net.refractions.udig.project.command.UndoableComposite.execute(UndoableComposite.java:79)

                at net.refractions.udig.project.command.CommandManager$Executor.execute(CommandManager.java:395)

                at net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:326)

                at net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:312)

                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Caused by: java.sql.SQLException: Connection is closed.

                at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.checkOpen(PoolingDataSource.java:185)

                at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:317)

                at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:3094)

                at org.geotools.jdbc.JDBCFeatureStore.getWriterInternal(JDBCFeatureStore.java:271)

                ... 15 more

 

I am using an Oracle database connection (on a win32 system), although I don’t think, after debugging, that it has anything to do with it.

 

It seems to me that there is a missing synchronization, because it doesn’t always happen at the same time and you need a fast commit hit after finishing the line drawing: Drawing the edited layer through a renderer (probably triggered by the commit) ends with closing the connection for drawing (this is standard), but somehow at this point it uses the editing connection (probably because the transaction is still busy and so the connection is currently registered with this layer?) for drawing request and closes it (inside dbcp), although it is still registered with the transaction in the edit manager.

 

Regards,

Hendrik Peilke



IBYKUS AG für Informationstechnologie, Erfurt / HRB 108616 - D-Jena / Vorstand: Helmut C. Henkel, Dr. Lutz Richter
Vorsitzender des Aufsichtsrates: Dr. Wolfgang Habel

Back to the top