• 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

Two persistance-unit at persistence.xml for two database but its thows exception

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
16:47:07,189 WARN [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@126e598
16:47:07,193 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
16:47:07,193 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:e14e:4b7e6e4f:2c1 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:e14e:4b7e6e4f:2c1 status: ActionStatus.ABORT_ONLY >))
16:47:07,193 INFO [STDOUT] org.hibernate.exception.GenericJDBCException: Cannot open connection

my persistence.xml file as below :

<persistence-unit name="MySqlDS">
<jta-data-source>java:/jdbc/tattooDS</jta-data-source>
<properties>

<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="none"/>
</properties>
</persistence-unit>
<persistence-unit name="JoomlaDS">
<jta-data-source>java:/jdbc/joomlaDS</jta-data-source>
<properties>

<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="none"/>
</properties>
</persistence-unit>

first Database sessionBean class:
public class CustomersBean implements IRCustomers {

@PersistenceContext(unitName="MySqlDS")
private EntityManager em;

}
Second Database session Bean class:

@Stateless
public class Jos_UserBean implements IRJos_User {

@PersistenceContext(unitName="JoomlaDS")
private EntityManager em;
}


please Help me out, is it possible to use two different database in one ejb
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Were you able to get some solution for this within the applications EAR file?
You can change the jboss JTA properties file to fix this solution.
reply
    Bookmark Topic Watch Topic
  • New Topic