[jboss-user] [JBoss/Spring Integration] - Clustering + Spring + Hibernate without EJBs -- possible?

duncow do-not-reply at jboss.com
Sun Jun 8 20:35:52 EDT 2008

Is it possible to use clustering with JBoss AS and JBoss Cache with Hibernate and Spring, but without using EJBs (i.e. without using the EntityManager)?  We have heard doubts about JBoss' ability to do this -- that we would be forced to use EJBs and/or JBoss' Hibernate service to take advantage of JBoss Cache's clustering capabilities.  But I don't see why this should be.

We are deploying everything, including Hibernate, in a single WAR file.  Thus we want to run our application on JBoss almost as if we were running it on pure Tomcat, using JBoss only for JBoss Cache and the JTA transaction manager it requires.  We don't want to incur the considerable expense of migrating to EJB 3 (at least not right now).

Our Java application uses Hibernate POJOs and Spring's declarative transaction management, similar to what Rod Johnson outlined in "J2EE Development without EJBs" back in 2004.  We have been running this on Tomcat 6.  We now want to run this app in a clustered environment, and we have been exploring options on Tomcat (e.g. Terracotta) but have run into problems and are keeping our options open.  Enter JBoss.

If we were to use Spring's JtaTransactionManager as the transactionManager for the AnnotationTransactionAttributeSource transactionInterceptor, would the JtaTransactionManager automatically delegate to JBoss's JTA provider?  Presumably JBoss Cache would use JTA by default.  Can we continue to use the Hibernate we have packaged in our WAR, or will we be forced to use JBoss' Hibernate service?  And if so, is that even an option with our EJB-free architecture?

Of course we can just fire it up and see what happens, and likely we will, but even if it seems to be working, it would be good to have some confirmation from the community that others have had success with this configuration.  If we're doing something fundamentally wrong I'd like to know up front, rather than find out through some subtle yet horrible error in production.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156516#4156516

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156516

More information about the jboss-user mailing list