All Forums Connectivity
28 Oct 2010
Pooled JDBC connection with WebSphere 7

I have a Spring and Ibatis application being deployed to WebSphere 7. This application already uses a DB2 database connection, and I am adding a Teradata connection.

I created the Teradata JDBC provider and data source in WebSphere following the instructions here: using-teradata-jdbc-driver-with-websphere-application- server

(As far as I can tell, anyway... most of the images on that page don't display for me.)

When I deploy my EAR and attempt to run the code that hits the Teradata database, I get an exception (shown below). I've tested the code via Junit tests (using a non-pooled connection injected by Spring), and the code does seem to be working properly. So, I'm fairly confident that the problem is related to my WebSphere setup or to EAR that is being deployed.

From what I've read so far, exceptions from TdgssConfigApi.GetMechanisms() usually imply a missing tgdssconfig.jar. However, I do have that jar listed in my classpath, and the jar that's referenced is the same one that's being used by my unit tests.

I'm a little lost. Can anyone suggest what I should be looking for next?




--- Cause: java.sql.SQLException
at com.ibatis.sqlmap.engine.mapping.statement.MappedState ment.executeQueryWithCallback( 201)
at com.ibatis.sqlmap.engine.mapping.statement.MappedState ment.executeQueryWithRowHandler( 149)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.q ueryWithRowHandler(
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryW ithRowHandler(
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryWi thRowHandler(
at com.nwa.cpax.dao.impl.AbstractDao.selectWithRowHandler (
... 8 more
Caused by: java.sql.SQLException
at on(
at on(
at GetConnection(
at org.springframework.jdbc.datasource.TransactionAwareDa taSourceProxy$TransactionAwareInvocationHandler.invoke (
at $Proxy27.prepareStatement(Unknown Source)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.prepare Statement(
at com.ibatis.sqlmap.engine.execution.SqlExecutor.execute Query(
at com.ibatis.sqlmap.engine.mapping.statement.MappedState ment.sqlExecuteQuery(
at com.ibatis.sqlmap.engine.mapping.statement.MappedState ment.executeQueryWithCallback( 189)
... 13 more
Caused by: javax.resource.spi.ResourceAllocationException
at Wrapper(
at 2436)
at on(
... 21 more
Caused by: java.lang.NullPointerException
at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms (DashoA1*..)
at com.teradata.tdgss.jtdgss.TdgssManager.(DashoA1*..)
at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(Das hoA1*..)
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(Gene
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(Ge
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameF orOid(
at com.teradata.jdbc.AuthMechanism.( 50)
at com.teradata.jdbc.jdbc.GenericInitDBConfigState.action (
at com.teradata.jdbc.jdbc_4.TDSession.( 201)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection. (
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnect ion(
at com.teradata.jdbc.TeraDataSourceBase.createNewConnecti on(
at com.teradata.jdbc.TeraPooledConnection.getConnection(T
at (
at l.createManagedConnection(WSManagedConnectionFactoryIm
at Wrapper(
... 26 more

tomnolan 594 posts Joined 01/08
29 Oct 2010

Yes, there's a problem with the images for the WebSphere How-To document that is posted here on Developer Exchange.

You can also find the document (with images) in the Teradata JDBC Driver documentation section of the Download Center:

You are correct that the NullPointerException from TdgssConfigApi indicates that tdgssconfig.jar could not be accessed. There's usually a very simple explanation for why the jar file can't be accessed. For example, perhaps the jar file name is misspelled in the classpath used for WebSphere.

29 Oct 2010

Well, I don't claim to fully understand this, but it looks like I can fix my problem by using *exactly* the same strings as the How To when I set up the JDBC provider. So, I had to use "Teradata Driver" for the name, and "Teradata JDBC" for the description.

I didn't think the name was supposed to be significant, but I've tried this on two different PCs, and each time it failed when I named the provider "Teradata" and started working when I named it "Teradata Driver". That's not a very satisfying explanation, but I'm not going to push my luck this close to the weekend.

Thanks for the suggestions.

01 Nov 2010

Unfortunately, this is more complicated than I gave it credit for. As of this morning, the connection is failing again, exactly as before, on both of my test Windows machines (Win2k and WinXP). WebSphere was stopped over the weekend and was restarted this morning, but that's the only difference from last Friday night.

I also deployed to two different AIX servers on Friday night and let my code run over the weekend. According to the logs, everything worked over the weekend. However, I just rebooted one of those servers (no code or config changes, just a stop/start of WebSphere) and now the connection fails with the exception shown above. I tried a few desperate work-arounds: rebooting the server, redeploying the application, deleting and re-creating the JDBC configuration from scratch, etc., but nothing made a difference.

The second AIX server, which has not been rebooted, is still working fine. Also, unit tests continue to work outside of the container using the simple TeraDriver.

Any other suggestions? At this point, I'm willing to try just about anything.

tomnolan 594 posts Joined 01/08
02 Nov 2010

If this problem is occurring for a customer Teradata system, then I recommend engaging Teradata Customer Support.

03 Nov 2010

Just to tie this off, I gave up on pooled connections. The application only needs to run one report once per day from this data warehouse, so I can live with a single connection. I'm using a pseudo-pool implemented by org.apache.commons.dbcp.BasicDataSource and injected directly out of my Spring application context. This seems to work more consistently.

You must sign in to leave a comment.