• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Help Please, Problems connecting to multiple datasources

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have this ejb that queries one database in one machine, gets the resultset massages the data opens a new connection to another database in a different machine and it is supposed to insert the data. However I get the following error message:

2009-02-13 18:32:50,188 INFO [STDOUT] org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e001:4995ebf3:117 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e001:4995ebf3:117 status: ActionStatus.ABORT_ONLY >)


I know it has to do with the different machine connections, because if I import the table and the data to the target database and use the same datasource to run the EJB it runs with no problem.
JBoss 4.2.2
Mysql database

Thanks for any help

[Edited by Jaikiran: Modified the subject to remove all caps]
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a very very common error when you're trying to use multiple datasources within Jboss 4.

You'll almost certainly find the answer instantly on a google.

Basically, it sounds like you're trying to use more than one datasource in the same transaction.

There's a simple way of getting around this - extrapolate the procedure that deals with the second datasource and use the @NewTransaction annotation to ensure a new transaction is started for the use of the second datasource.

You can read more here (including other methods of getting around this): http://www.jboss.org/community/docs/DOC-11443

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic