• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • paul wheaton
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
  • Himai Minh
Bartenders:

Spring and persistence unit with jboss

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My project initially develop using with out persistence unit and project is spring,Struts2 hibernate intergration one. Now I need to use jboss connection pool and persistence unit.I need to handle transaction by conatainer also not like in the code i posted(dao). Please change my code to meet that requirement.
current spring.xml




sample DAO class

 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to look up the data source from JNDI instead of DriverManagedDataSource. Also you should use the JTATransactionManager. JTA transaction Manager will use the transaction manager provided by JBoss
 
Dilshan De Silva
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jayesh A Lalwani wrote:You need to look up the data source from JNDI instead of DriverManagedDataSource. Also you should use the JTATransactionManager. JTA transaction Manager will use the transaction manager provided by JBoss


can you give me sample code or replace my code with changes...
I have tried several and non of them succeed..
thanks.
 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For looking up your data source from JNDI, you have to do



Replace JNDI-name with the name of your JNDI data source.

For using the JBoss transaction manager, do



These setting are pretty much what you find all over the net. If you have tried them already, and they are not working, you will have to figure out what the problem is by looking at the error messages.
 
Dilshan De Silva
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jayesh A Lalwani wrote:For looking up your data source from JNDI, you have to do



Replace JNDI-name with the name of your JNDI data source.

For using the JBoss transaction manager, do



These setting are pretty much what you find all over the net. If you have tried them already, and they are not working, you will have to figure out what the problem is by looking at the error messages.





how do I change this code.
 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's wrong with it?
 
Dilshan De Silva
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jayesh A Lalwani wrote:What's wrong with it?



this is my spring xml after make changes you have mentioned.

There is no session factory bean and I cant set session factory to DAO class as i done earlier.
soo how to change my DAO class and annotate with Transactional.
 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you should put the session factory back in the spring XML then, eh?
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic