Thanks for your fast response ;). Our application server is Glassfish with persistence provide eclipselink. The callback listener is within the ejb container but lookup for services doesn´t work (java:comp/env/...). I always get a name not found exception. The only thing that works is creating a new EntityManager instance with the EntityManagerFactory. With the entity manager I am able to write the logs but that is not very nice because we have Services for that.
What does the spec say about database actions in a callback method?
I doesn´t find that point in the spec at the moment but here is something from another page:
"To avoid conflicts with the original database operation that fires the entity lifecycle event (which is still in progress) callback methods should not call EntityManager or Query methods and should not access any other entity objects"
I´m not sure if using callback methods is the best way to solve this problem.