Posted in November 23, 2011 ¬ 19:52h.Piotr
Sometimes you need to pass some additional / contextual data to the called EJB method. Because it’s a contextual data you don’t want to end in changing signatures of all your EJB methods just to add a single or few such parameters. It is possible to add context data using the SessionContext object. 1 person [...]
Read the rest of this entry »
Posted in November 23, 2011 ¬ 18:32h.Piotr
Recently, I’ve bumped into few posts on StackOverflow where people tend to compare container managed EntityManager instances (so the one injected by the container) by invoking EntityManager#toString() method. I’ve felt that it’s fundamentally wrong to compare EntityManager instances without knowing how they’re managed by the JPA provider or the Server Application. And what if this [...]
Read the rest of this entry »
Posted in September 1, 2011 ¬ 10:42h.Piotr
You probably know that if you use BMT (Bean Managed Transactions) you can get information about current transaction status by using UserTransaction interface (which implementation can be fetched either by JNDI or using dependency injection) and executing it’s getStatus() method. If you use CMT (Container Managed Transactions) you cannot use UserTransaction interface. Instead, you can [...]
Read the rest of this entry »
EJB, Javabmt, cmt, dependency injection, EJB, java, jndi, status, transactions, transactionsynchronizationregistry, usertransaction