
|
If you were logged in you would be able to see more operations.
|
|
|
|
When using the Spring TransactionAwareDatasource to wrap connections to the database for transactional security, the FetchPerTransactionJdbcIndexInput.bindBlob and getBoundBlob are broken. The reason is that the connections returned are all ConnectionProxy instances. The caching seems to even return cached blobs from differenct connections sometimes which causes rather nasty blob exceptions. If fixed the problem by creating a local build with a modified DataSourceUtils.getTargetConnection() which also takes spring connectionproxies into account, however this is probably not the best solution because of the spring dependency this introduces.
public static Connection getTargetConnection(Connection conn) {
if (conn instanceof ConnectionProxy ) {
return ((ConnectionProxy) conn).getTargetConnection();
}
// We need to do the same for spring based ConnectionProxy, or the same error will occur:
if (conn instanceof org.springframework.jdbc.datasource.ConnectionProxy) {
return ((org.springframework.jdbc.datasource.ConnectionProxy)conn).getTargetConnection();
}
return conn;
}
BTW: I've not assigned it to any component because there is no separate JdbcDirectory component.
|
|
Description
|
When using the Spring TransactionAwareDatasource to wrap connections to the database for transactional security, the FetchPerTransactionJdbcIndexInput.bindBlob and getBoundBlob are broken. The reason is that the connections returned are all ConnectionProxy instances. The caching seems to even return cached blobs from differenct connections sometimes which causes rather nasty blob exceptions. If fixed the problem by creating a local build with a modified DataSourceUtils.getTargetConnection() which also takes spring connectionproxies into account, however this is probably not the best solution because of the spring dependency this introduces.
public static Connection getTargetConnection(Connection conn) {
if (conn instanceof ConnectionProxy ) {
return ((ConnectionProxy) conn).getTargetConnection();
}
// We need to do the same for spring based ConnectionProxy, or the same error will occur:
if (conn instanceof org.springframework.jdbc.datasource.ConnectionProxy) {
return ((org.springframework.jdbc.datasource.ConnectionProxy)conn).getTargetConnection();
}
return conn;
}
BTW: I've not assigned it to any component because there is no separate JdbcDirectory component. |
Show » |
|
ERROR org.compass.spring.device.hibernate.SpringHibernate3GpsDevice - {hibernateDevice}: Failed to index the database
org.compass.core.engine.SearchEngineException: Failed to create resource {course} [stored/uncompressed,indexed<alias:cou
rse>],[stored/uncompressed,indexed<$/course/id:1089>],[stored/uncompressed,indexed,tokenized<courseName:Jones>],[stored/
uncompressed,indexed,tokenized<designer:Rees Jones>],[stored/uncompressed,indexed,tokenized<city:Plymouth>]; nested exce
ption is org.apache.lucene.store.jdbc.JdbcStoreException: Failed to read transactional blob [_a.fdt]; nested exception i
s java.lang.NullPointerException: null
org.apache.lucene.store.jdbc.JdbcStoreException: Failed to read transactional blob [_a.fdt]; nested exception is java.la
ng.NullPointerException: null
java.lang.NullPointerException
at org.apache.lucene.store.jdbc.index.FetchPerTransactionJdbcIndexInput.readInternal(FetchPerTransactionJdbcInde
xInput.java:247)
at org.apache.lucene.store.jdbc.index.FetchPerTransactionJdbcIndexInput.readInternal(FetchPerTransactionJdbcInde
xInput.java:225)
at org.apache.lucene.store.ConfigurableBufferedIndexInput.readBytes(ConfigurableBufferedIndexInput.java:45)
at org.apache.lucene.index.CompoundFileWriter.copyFile(CompoundFileWriter.java:211)
at org.apache.lucene.index.CompoundFileWriter.close(CompoundFileWriter.java:169)
at org.apache.lucene.index.SegmentMerger.createCompoundFile(SegmentMerger.java:153)
at org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:1601)
at org.apache.lucene.index.IndexWriter.maybeMergeSegments(IndexWriter.java:1415)
at org.apache.lucene.index.IndexWriter.flushRamSegments(IndexWriter.java:1352)
at org.apache.lucene.index.IndexWriter.maybeFlushRamSegments(IndexWriter.java:1344)
at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:697)
at org.compass.core.lucene.util.LuceneUtils.createResource(LuceneUtils.java:70)
at org.compass.core.lucene.engine.transaction.BatchInsertTransaction.doCreate(BatchInsertTransaction.java:208)
at org.compass.core.lucene.engine.transaction.AbstractTransaction.create(AbstractTransaction.java:109)
at org.compass.core.lucene.engine.LuceneSearchEngine.create(LuceneSearchEngine.java:330)
at org.compass.core.impl.DefaultCompassSession.create(DefaultCompassSession.java:288)
at org.compass.gps.device.hibernate.AbstractHibernateGpsDevice$HibernateIndexEntitiesIndexer.performIndex(Abstra
ctHibernateGpsDevice.java:100)
at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(Concurre
ntParallelIndexExecutor.java:101)
at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:137)
at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:156)
at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecuto
r.java:99)
at org.compass.core.util.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
at org.compass.core.util.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java
:665)
at org.compass.core.util.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690
)
at java.lang.Thread.run(Thread.java:534)