Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XA Datasource specified, visible in server, not working...

843859Mar 15 2008
I'm working with Glassfish, Toplink, and Postgres.

I have a session bean that injects a persistence context and another session bean that also has a persistence context. ie:
@Stateless
public class AccountManagerEJBBean 
        extends    SomeBaseClass
        implements SomeApplication.model.AccountManagerEJB 
{        
    @PersistenceContext
    private EntityManager _manager;
                      
    @EJB
    private ConfigEJB configEJB;
    //The above bean also has a persistence context member.

//...etc
When I call _manager.persist() , I get the following exception :
java.lang.IllegalStateException: Local transaction already has 1 non-XA Resource: cannot add more resources.
The datasource that this bean is using is configured as an XA datasource. In the Admin Console, under Resources > JDBC > Connection Pools > [myConnectionPool] , the Resouce Type is "javax.sql.XADataSource".
This reflects the configuration specified in my sun-resources.xml
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.postgresql.ds.PGSimpleDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="jdbc/SomeConnectionPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.XADataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
I don't know if this should matter, but the injected EJB (ConfigEJB) is from another module, within the same application, that uses the same datasource.

Does anybody know what I am missing? Any help would be really appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2008
Added on Mar 15 2008
0 comments
140 views