This piece of code is used in a webservice deployed inside nuxeo.
I have found in code examples and nuxeo API a possible solution:
Context ctx = new InitialContext();
UserTransaction userTx= (UserTransaction)
ctx.lookup("UserTransaction");
userTx.begin();
try{
manager = Framework.getService(RepositoryManager.class);
repo = manager.getRepository(repository);
session = repo.open();
nuevoDoc=session.createDocumentModel("model");
nuevoDoc = session.createDocument(nuevoDoc);
...............
userTx.commit();
}catch(Exception e){
userTx.rollback();
}
This works, but it's the right solution or you recommended another one.
thanks,
Miguel
--
Posted by "mamlspa" at Nuxeo Discussions <http://nuxeo.org/discussions>
View the complete thread:
<http://www.nuxeo.org/discussions/thread.jspa?threadID=2702#7760>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm