Revision 47606 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.sqlite/org.gvsig.sqlite.provider/src/main/java/org/gvsig/sqlite/dal/SQLiteHelper.java
SQLiteHelper.java | ||
---|---|---|
104 | 104 |
SQLiteConfig config = new SQLiteConfig(); |
105 | 105 |
config.setSharedCache(true); |
106 | 106 |
config.enableLoadExtension(true); |
107 |
config.setTransactionMode(TransactionMode.IMMEDIATE); |
|
108 |
config.setOpenMode(SQLiteOpenMode.NOMUTEX); |
|
107 |
// config.setTransactionMode(TransactionMode.IMMEDIATE);
|
|
108 |
// config.setOpenMode(SQLiteOpenMode.NOMUTEX);
|
|
109 | 109 |
|
110 |
// config.setJournalMode(SQLiteConfig.JournalMode.WAL);
|
|
111 |
// config.setTransactionMode(SQLiteConfig.TransactionMode.DEFERRED);
|
|
112 |
// config.setSynchronous(SQLiteConfig.SynchronousMode.OFF);
|
|
113 |
// config.setOpenMode(SQLiteOpenMode.FULLMUTEX);
|
|
110 |
config.setJournalMode(SQLiteConfig.JournalMode.WAL); |
|
111 |
config.setTransactionMode(SQLiteConfig.TransactionMode.DEFERRED); |
|
112 |
config.setSynchronous(SQLiteConfig.SynchronousMode.OFF); |
|
113 |
config.setOpenMode(SQLiteOpenMode.FULLMUTEX); |
|
114 | 114 |
|
115 | 115 |
|
116 | 116 |
config.setPragma(SQLiteConfig.Pragma.CASE_SENSITIVE_LIKE, "true"); |
... | ... | |
385 | 385 |
@Override |
386 | 386 |
public SRSSolver getSRSSolver() { |
387 | 387 |
if (this.srssolver == null) { |
388 |
JDBCConnection conn = null; |
|
388 | 389 |
try { |
389 |
this.srssolver = GeopackageUtils.createSRSSolver((SQLiteConnection) this.getConnection().get()); |
|
390 |
conn = this.getConnection(); |
|
391 |
this.srssolver = GeopackageUtils.createSRSSolver((SQLiteConnection) conn.get()); |
|
390 | 392 |
} catch (Exception ex) { |
391 | 393 |
throw new RuntimeException("Can't get SRSSolver", ex); |
394 |
} finally { |
|
395 |
JDBCConnection.closeQuietly(conn); |
|
392 | 396 |
} |
393 | 397 |
} |
394 | 398 |
return this.srssolver; |
395 | 399 |
} |
396 |
|
|
400 |
|
|
401 |
private GeopackageGeometryParser geometryParser = null; |
|
402 |
|
|
397 | 403 |
@Override |
398 | 404 |
public Geometry getGeometryFromColumn(ResultSet rs, int index) throws DataException { |
399 | 405 |
try { |
400 | 406 |
if( this.getGeometrySupportType() == GeometrySupportType.NATIVE ) { |
401 | 407 |
byte[] bytes = rs.getBytes(index); |
402 | 408 |
if( GeopackageUtils.isGeopackageGeometry(bytes) ) { |
403 |
GeopackageGeometryParser parser = GeopackageUtils.createGeometryParser(); |
|
404 |
Geometry geom = parser.parseToGeometry(null, bytes); |
|
409 |
if(geometryParser == null){ |
|
410 |
geometryParser = GeopackageUtils.createGeometryParser(); |
|
411 |
} else { |
|
412 |
geometryParser.clean(); |
|
413 |
} |
|
414 |
Geometry geom = geometryParser.parseToGeometry(null, bytes); |
|
405 | 415 |
return geom; |
406 | 416 |
} |
407 | 417 |
} |
Also available in: Unified diff