users@glassfish.java.net

Re: XADataSource

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 08 Mar 2010 16:30:57 -0800

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
>