gvSIG CE and SEXTANTE GIS Bug Tracker on MantisBT
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000517gvSIG Community EditionCAD editorpublic2014-05-16 17:482017-01-23 11:13
Assigned Tovicgonco 
PlatformOSOS Version
Product VersiongvSIG CE (trunk) 
Target VersiongvSIG CE 1.0.0Fixed in Version 
Summary0000517: Cannot save changes to OGR datasources
Descriptionjava.lang.RuntimeException: bug! OGR driver is not being handled
    at org.gvsig.ogr.drivers.SQLiteDriverFactory.startEdition(SQLiteDriverFactory.java:185)
    at org.gvsig.ogr.drivers.SQLiteDriver.preProcess(SQLiteDriver.java:18)
    at com.iver.cit.gvsig.fmap.edition.EditableAdapter.saveEdits(EditableAdapter.java:338)
    at com.iver.cit.gvsig.fmap.edition.EditableAdapter.stopEdition(EditableAdapter.java:283)
    at com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter.stopEdition(VectorialEditableAdapter.java:985)
    at com.iver.cit.gvsig.StopEditing.saveLayer(StopEditing.java:276)
    at com.iver.cit.gvsig.StopEditing.stopEditing(StopEditing.java:189)
    at com.iver.cit.gvsig.StopEditing.execute(StopEditing.java:127)
Steps To ReproduceCreate an SQLite layers (I tested one with polygons).

Start editing on the layer.

Stop editing and try to save changes.

--> the above error is thrown.
TagsNo tags attached.
Attached Files

- Relationships
related to 0000913assignedvicgonco Add support for 3D vertices (INITIAL WORK) 

-  Notes
benducke (developer)
2016-08-10 19:24

SQLite layers should be handled by our own driver with write support, not by the OGR extension, which has only read-only drivers!
vicgonco (administrator)
2017-01-19 09:02

I've been unabled to reproduce this. I tried the following:

- Open gvSIG CE (both from downloaded binaries and source from Eclipse).
- View -> Create Layer As -> SQLite Spatial Table...
- Enter any name and "Polygon type".
- Enter fields; I tried both a single string field (simply clicking Add field) and no fields.
- Enter a valid path (both with .sqlite extension and no extension) and a
- Create a single polygon with 3-6 vertex.
- Stop editing and save.

It always worked as expected, both from binaries and source+eclipse. Can you still reproduce it? If so, can you give me a bit more detail on your steps?

Regarding the message ("OGR driver is not being handled") it was misleading. It is actually managed by the SQLite driver. I fixed the message.
benducke (developer)
2017-01-20 12:57

I can confirm that it works if you create a new layer and then edit it.

But when I remove that same layer, then add it to the project again (via the "SQLite" tab), put it into editing mode, edit it and choose to save, I get a COMMIT error:

ERROR 1: COMMIT transaction failed: database is locked
2017-01-20 13:44:50,936 ERROR [AWT-EventQueue-0] (NotificationManager.java:119) - java.lang.RuntimeException: OGR Error: General Error
java.lang.RuntimeException: OGR Error: General Error
    at org.gdal.ogr.ogrJNI.Layer_CommitTransaction(Native Method)
    at org.gdal.ogr.Layer.CommitTransaction(Layer.java:215)
    at org.gvsig.ogr.drivers.AbstractOGRDriver.postProcess(AbstractOGRDriver.java:825)
    at org.gvsig.ogr.drivers.SQLiteDriver.postProcess(SQLiteDriver.java:44)
    at com.iver.cit.gvsig.fmap.edition.EditableAdapter.saveEdits(EditableAdapter.java:401)
    at com.iver.cit.gvsig.fmap.edition.EditableAdapter.stopEdition(EditableAdapter.java:295)
    at com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter.stopEdition(VectorialEditableAdapter.java:792)
    at com.iver.cit.gvsig.StopEditing.saveLayer(StopEditing.java:277)
    at com.iver.cit.gvsig.StopEditing.stopEditing(StopEditing.java:189)
    at com.iver.cit.gvsig.StopEditing.execute(StopEditing.java:127)

If I "Accept" the error, then try to save again, I get a related but slightly different "BEGIN transaction" error:

ERROR 1: BEGIN transaction failed: cannot start a transaction within a transaction
2017-01-20 13:46:16,478 ERROR [AWT-EventQueue-0] (NotificationManager.java:119) - java.lang.RuntimeException: OGR Error: General Error
java.lang.RuntimeException: OGR Error: General Error
    at org.gdal.ogr.ogrJNI.Layer_StartTransaction(Native Method)
    at org.gdal.ogr.Layer.StartTransaction(Layer.java:211)
    at org.gvsig.ogr.drivers.AbstractOGRDriver.preProcess(AbstractOGRDriver.java:751)
    at org.gvsig.ogr.drivers.SQLiteDriver.preProcess(SQLiteDriver.java:23)
    at com.iver.cit.gvsig.fmap.edition.EditableAdapter.saveEdits(EditableAdapter.java:350)
    at com.iver.cit.gvsig.fmap.edition.EditableAdapter.stopEdition(EditableAdapter.java:295)
    at com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter.stopEdition(VectorialEditableAdapter.java:792)
    at com.iver.cit.gvsig.StopEditing.saveLayer(StopEditing.java:277)
    at com.iver.cit.gvsig.StopEditing.stopEditing(StopEditing.java:189)
benducke (developer)
2017-01-20 13:01

The behavior is different if I first quit the application and then load the SQLite layer! In that case, I can put the layer into editing mode, modify it and save.
vicgonco (administrator)
2017-01-23 10:13

It should be fixed now. The problem was that the SQLite driver used for creating the layer remained open when removing the layer.
benducke (developer)
2017-01-23 11:13

Seems to work now. Strangely, I could never reproduce the exact error that I initially reported. We can consider write support for SQLite as working now.

- Issue History
Date Modified Username Field Change
2014-05-16 17:48 benducke New Issue
2014-05-16 17:48 benducke Status new => assigned
2014-05-16 17:48 benducke Assigned To => vicgonco
2016-08-10 19:20 benducke Relationship added related to 0000913
2016-08-10 19:24 benducke Note Added: 0000805
2017-01-19 09:02 vicgonco Note Added: 0000850
2017-01-19 09:03 vicgonco Status assigned => feedback
2017-01-20 12:57 benducke Note Added: 0000851
2017-01-20 12:57 benducke Status feedback => assigned
2017-01-20 13:01 benducke Note Added: 0000852
2017-01-23 10:13 vicgonco Note Added: 0000853
2017-01-23 11:13 benducke Note Added: 0000854
2017-01-23 11:13 benducke Status assigned => resolved
2017-01-23 11:13 benducke Resolution open => fixed

Copyright © 2000 - 2011 MantisBT Group
Hosted by Sourceforge.netPowered by Mantis Bugtracker