On 30 Oct 2008, at 12:16, Bogdan Tatar wrote: > I have one question regarding the sessions that can and should be > opened > on a registered repository in Nuxeo.By default Nuxeo offers a session > opened on the default reposirtory from the web level,through a seam > component named 'documentManager'.Once opened this session is always > returned as it is cached in the seam component > DocumentManagerBusinessDelegate which has the name > 'documentManager'.My > question is,if it is ok to open another session on the same default > repository,in a different place,lets say a singleton,and use this > session to make modifications on the default repository,without > closing > it after, while in the same time the session given by the seam > component > 'documentManager' can also be used to make modifications on the > default > repository.
No, it's not correct. In the JCA spec (which Java EE uses), a single transaction cannot get two different connections to the same transactional resource (and a CoreSession / DocumentManager is considered a connection). If you want to use a second connection, then you can but while you're using it you cannot use the original one, you must close it before returning to your use of the original connection. Anyway doing this kind of caching of session is usually counter productive, there's already heaving caching done by the datasource/JCA layer, no need to cache things another time. Florent -- Florent Guillaume, Head of R&D, Nuxeo Open Source, Java EE based, Enterprise Content Management (ECM) http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87 _______________________________________________ ECM mailing list [email protected] http://lists.nuxeo.com/mailman/listinfo/ecm
