Finally I got working a tricky solution but I dislike it. In Netbeans, I created a new EJB module, generated entites from database, generated JPA controllers from entities, defined a Message driven bean. The message driven bean read messages from a queue that get them from a Quartz job in the web app. The JPA controller was refactored into a stateful session bean (extracted a local interface from it, renamed it) and added the annotation: @TransactionManagement(TransactionManagementType.BEAN). Then the MDB calls the bussiness method of the session bean (refactored JPA controller) on message arriving.
All is working now, but still want to know if there is a better design to get scheduling working inside a web application, improving code reuse.
Thanks in advance.
[Message sent by forum member 'gxcr']
http://forums.java.net/jive/thread.jspa?messageID=477017