• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What's wrong with my spring config?

 
Ranch Hand
Posts: 229
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following Spring/Hibernate configuration. When I run it under WebLogic, it works fine. OFAPool is a connection pool defined in WebLogic.

However, I want to run Spring/Hibernate with my stand alone program. So I commented out the OFAPool for JndiObjectFactoryBean (since WebLogic is no longer involved), and then uncomment the second tag in the configuration below. I created a class called DevelopmentDriverManagerDataSource, which extends BasicDataSource. This will directly connect to my database.



However, when I run the stand-alone program, I got the below error. It seems that JtaTransactionManager is not set correctly. I don't understand why it works well using WebLogic's database connection pool, but not with stand-alone program. Please help. Thanks in advance.

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, simply put, Weblogic has a JTATransactionManager that you are relying on, and when run stand-alone, you do not have one. Datasources do not provide the TransactionManager.

In your stand-alone configuration, why not change your transactionManager to the Spring TransactionManager. Actually, I thought if you use the Spring TransactionManager, it will just hook into whatever TransactionManager that is available in your environment. So in the case of Weblogic it hooks into JTA, on stand-alone, the Spring Framework provides its own.

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic