[ http://issues.apache.org/jira/browse/TAPESTRY-882?page=all ]
Giampaolo Tomassoni updated TAPESTRY-882: ----------------------------------------- Attachment: Example.zip > A JBoss EJB3 hivemind service > ----------------------------- > > Key: TAPESTRY-882 > URL: http://issues.apache.org/jira/browse/TAPESTRY-882 > Project: Tapestry > Type: Improvement > Components: Contrib > Versions: 4.0 > Environment: JBoss 4.0.4 > Reporter: Giampaolo Tomassoni > Priority: Minor > Attachments: Example.zip > > I don't know if I just reinvented the weel, but I had no luck in finding a > way to access my database by injection of a javax.persistence.EntityManager > from Tapestry. > More specifically, I needed access from Tapestry to the > javax.persistence.EntityManager instance that was supposed to be tied to my > running thread. Also, since EJB3 persistence is implemented through Hibernate > in JBoss and I prefer to use criteria queries instead of the EJB3 standard > ones, sometimes I find useful to have access to the Hibernate Session > instance overlooking my http request. > So, I developed a hivemind service for this purpose. I'm attaching its > sources for two purposes: > 1) maybe someone finds it useful for his/her purposes. Of course, it may > be eventually included in Tapestry as well; > 2) since I'm new to hivemind and all this "injection" era, I would like to > have my code reviewed by someone more knowledgeable than me. This is to > avoid going to use something that crashes down when the wind blows > in a given way and the sun is at sunset and a big load is moved... > I named the hivemind service JbossEntityManagerFactory, but it yields either > a javax.persistence.EntityManagerFactory or a (proxy) to a > javax.persistence.EntityManager or org.hibernate.Session instance. > Of course, I put it in an examplar hive into the hivemind registry and the > java packaging. > I'm looking for your suggestions and reviews. > Regards, -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]