users@glassfish.java.net

RE: Re: XADataSource

From: Martin, Ray <armart3_at_tycho.ncsc.mil>
Date: Tue, 9 Mar 2010 07:17:14 -0500

Thank you, Sir

I changed to
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
and
oracle.jdbc.xa.client.OracleXADataSource
respectively.

Now,
The oracle instance does not save data to the table though no errors show
The mysql instance is doing great.
 
I am looking how to resolve this.

-----Original Message-----
From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
Sent: Monday, March 08, 2010 7:31 PM
To: users_at_glassfish.dev.java.net
Subject: Re: XADataSource

You need not only to choose javax.sql.XADataSource, but the corresponding XA data source class name.

It's the requirements for the transaction service to use XA protocol in a Java EE environment. While it's possible to hide this requirement from a user if only
1 resource participates in each transaction, when 2 or more are present, all but one must be configured for an XA support.

Regards,
-marina

Martin, Ray wrote:
>
> Using Glassfish v2, Netbeans6.8
>
> Have an Oracle database and a MySQL database for a starter - eventually there will be multiples of each.
>
> In my first use case, I do not care about transactions across both data sources.
>
> In Glassfish, I have set both connection pools to
> javax.sql.XADataSource Restarted Glassfish Deploy and run my EJBModule
> project.
> Get the Toplink 4002 - cannot have more than one non-XA.
>
> I don't.
>
> I have two XA data sources.
>
> I got the EclipseLink jars from Glassfish v3 modules directory and placed into Glassfish v2 lib directory.
>
> Selected EclipseLink for persistence.xml - get EclipseLink error same as Toplink error.
>
> Any suggestions on how to proceed?
>
> The session bean has two "Façade" beans injected with @EJB. Each "Façade" bean has an EntityManager using one of the PUs in persistence.xml. Calling the first "Façade" bean's create method is okay. Calling the second "Façade" bean's create method blows the error.
>
> Commenting out the call to the second "Façade" beans's create method - no error.
> Put that one back
> And comment the call to the first "Façade" bean's create method - a call to the second "Façade" bean's create method still blows error.
>
> First and second are the order of the PU in persistence.xml and also happens to be the order they are called in the code.
>
> I have no clue how to fix this problem.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: users-help_at_glassfish.dev.java.net