i have any question..
how to configure Transaction in application which developed in Spring and Hibernate?..
i use Spring just as IoC..
which one is good for implementation..
do i have to use JTA or i just use Embedded Transaction which provided by Spring?..
now.. i do like this one in Spring container..
and in My DAO :
is it can accepted as Simple Transaction?..
or i have to use JTA?..
is it any link for integrating between Spring IoC, Hibernate/JPA, and JTA?..
The Spring Framework's transaction management support significantly changes traditional thinking as to when a J2EE application requires an application server.
In particular, you don't need an application server just to have declarative transactions via EJB. In fact, even if you have an application server with powerful JTA capabilities, you may well decide that the Spring Framework's declarative transactions offer more power and a much more productive programming model than EJB CMT.
Typically you need an application server's JTA capability only if you need to enlist multiple transactional resources, and for many applications being able to handle transactions across multiple resources isn't a requirement.
Thanks for your reply..
in that example, we can use Annotation @Transactional..
i have modified my application's configuration..
and shown like the following code :
is it configuration true?..
iam using sessionFactory and transaction manager..
and the DAO code is like this :
is it DAO have been configured as Transactional mode?..
iam sorry before.. iam still confusing about the rollBackFor Property..
i've been configure Transactional Annotation like this one :
is it the rollback will executed if any errors occured?..
i just use rollbackFor=Exception.class, and not use specify another Exception classes, beacuse all of the Exception classes is inheritated of "java.lang.Exception"..
Thank's in advance
Well, if you define general Exception class, then it means you want to rollback the particular transaction in case any exception occurs. There are cases when you still want to commit the transaction if one kind of exceptions occur and rollback the transaction when the other kind of exceptions occur. I hope it made it clear now.
yeah iam using hibernate..
is it enough to make transaction just use the sessionFactory Hibernate?..
The Class extends HibernateDaoSupport..
and i use the following code :
Thanks in advance...
I am configuring hibernate in my spring project i hope you are able to configure.I have a question that you are using persistence.xml or not or there is any kind of entry in your web.xml file for your persistence.xml file.can you provide me your sample files which you use in your project just a basic one.