From: David Jencks <email@example.com>
Date: 01/27/2011 11:46AM
Subject: Re: AS/400 config JPA and Database Pools
Can you be more explicit about the rollback problems? That might point towards the cause.
in my experience when a non-jta-datasource is needed and missing, nothing works so it's really obvious there is a problem. If many things work you might not need the non-jta-datasource but I would add it anyway. Once you have everything working properly you can experiment with removing it and see if new problems show up. It is most likely to be needed for DDL (e.g. initial table creation) and key value/sequence generation.
You should definitely use the db2 specific adapters. We have an ISeries specific db2 adapter now but I doubt it is included in your was ce version (I think it is in the latest version if you can upgrade). You can get it at
You wont be able to deploy this directly from the admin console, but what you can do is use the admin console to generate a plan for one of the included db2 adapters, copy it to a file, and deploy the adapter + plan using the command line or the admin console.
You should set up the jta datasource using xa-transaction and transaction-caching (the plan should look like this:
) If you leave out the transaction-caching element you will eventually get very strange errors where 2 transactions try to use the same connection or a commit/rollback is tried on a closed connection.
The non-jta datasource should be set up with no-transaction support.
Hope this helps!
I'm using JPA with an AS/400 (DB2/i) in an EJB/EAR application.
We're having trouble with rollbacks, which also has me wondering what else might work better if I knew how to configure this correctly.
Does anyone have any best practices for this setup? Do I need both a JTA and non-JTA datasource defined for JPA? (I've read posts where that was needed for Derby.)
Also, when I create the server Database Pools, what values should I use? Specifically, I've been using Database Type "Other", but does using that reduce my functionality? Should I be using one of the "DB2" values, even though its on the i? And what about Transaction Type?
We're running WASCE 22.214.171.124. Thanks!
Huber & Associates
Office: 573-634-5000, Mobile: 573-298-1040