This content has been marked as final.
Show 2 replies
-
1. Re: Mutiple sessions and transactions.
wdfink Oct 17, 2011 2:07 AM (in response to ivanlatysh)Hi Ivan,
could you describe a bit more in detail what you want to achieve?
As I understand you will commit/rollback both different !??
-
2. Re: Mutiple sessions and transactions.
ivanlatysh Oct 17, 2011 10:27 AM (in response to wdfink)I am using Hibernate fulltext search, and I need to read underlaying indexes and save data back into the database.
So I need 1 session to get to the indexes:
// get session Session indexReaderSession = (Session) manager.getDelegate(); // get fulltext session FullTextSession fullTextSession = Search.getFullTextSession(indexReaderSession); // get search factory SearchFactory searchFactory = fullTextSession.getSearchFactory(); // get directory provider DirectoryProvider dealDirectoryProvider = searchFactory.getDirectoryProviders(MyClass.class)[0]; // get reader provider ReaderProvider readerProvider = searchFactory.getReaderProvider(); // get index reader IndexReader reader = readerProvider.openReader(dealDirectoryProvider);
And 1 session to write the data.
I can not use the same session in this case.