Hello,
is there something available or planned concerning EJB-transactions.
A Java EE JPA EntiyManager is per default related to the EJB-transaction
handling. When the first EJB method is called a transaction is started and
when the last EJB method call ends the transaction is closed. I have seen a
JPA implementation which provides an orient EntityManager but i think you
loose a lot of graph funktionality when not using the OrientGraph API
directly.
I would like get the OrientGraph injected with @Resource or @Inject in my
EJB like a JPA EntityManager and let the container handle the transaction.
BTW: I created a simple filter which deals with the OrientGraph which works
fine in my web application:
@WebFilter("/*")
public class OrientDBFilter implements Filter {
@Inject
OrientDbProducers odbProducer;
@Inject
Log log;
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws ServletException {
try {
chain.doFilter(request, response);
} catch (IOException e) {
throw new ServletException(e);
} finally {
ODatabaseDocumentInternal database = ODatabaseRecordThreadLocal.
INSTANCE.getIfDefined();
if (database != null) {
database.close();
ODatabaseRecordThreadLocal.INSTANCE.remove();
}
}
}
@Override
public void destroy() {
odbProducer.getGraphFactory().close();
}
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.