Do I need an application server for transaction management?, really.
My question is for Spring framework.
They said (Spring Documentation),
“Typically you need an application server’s JTA capability only if your application needs to handle transactions across multiple resources”,
I use Jboss AS Server and JBoss can provide connections from a connection pool and manage transactions.
My configuration file use (local):
<!-- Transaction Config -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory"/>
Do I need to change to (Global):
<bean id="txManager"
class="org.springframework.transaction.jta.JtaTransactionManager"/>
I order to use connection pool from Jboss.
Spring documentation say :
In particular, you do not need an application server simply for declarative transactions through EJBs. In fact, even if your application server has powerful JTA capabilities, you may decide that the Spring Framework’s declarative transactions offer more power and a more productive programming model than EJB CMT.
Thanks.
Usage of ApplicationServer to provide transaction management depends on what is your usecase,
If your transaction is distributed (spanning multiple parties) then you would like to use JTA transaction capabilities, for plain database transaction you dont need application server and Spring built in transaction capability is more than enough.
Though it also depends on your architecture defined for your application, at some organization it is kind of a practice to use JTA even though the transaction boundary is limited and doesn’t require distributed transaction.
You may wish to read something about distributed transaction to decide if you would need JTA or just Spring local transaction.
Some references:
http://www.javaworld.com/javaworld/jw-04-2007/jw-04-xa.html
http://en.wikipedia.org/wiki/Java_Transaction_API