hello,
<br/>
i'm printing reports with a JNDI datasource (export to PDF) from JBoss EAP 5.1 with crystal reports runtime: 12.2.210.1215
<br/>
the connections from the report was changed the following way (designed with JDBC) for report and all subreports::
<br/><br/>
<pre>
IConnectionInfo newCon = new ConnectionInfo();
newCon.setKind(ConnectionInfoKind.SQL);
PropertyBag bag = new PropertyBag();
bag.put("JNDI Datasource Name", dbJNDIName);
bag.put("Database DLL", "crdb_jdbc.dll"); // required!!!
newCon.setAttributes(bag);
clientDoc.getDatabaseController()
.replaceConnection(oldCon, newCon, null, DBOptions._doNotVerifyDB);
</pre>
<br/>
<br/>
and after printing the report was closed like:<br/>
<pre>
if (clientDoc != null && clientDoc.isOpen()) {
clientDoc.close();
}
</pre>
<br/>
<br/>
If i'm using a:<br/>
<br/>
<pre>
<no-tx-datasource>
<jndi-name>assekuradeurNOTXDatasource</jndi-name>
<connection-url>jdbc:postgresql://....</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>...</user-name>
<password>...</password>
</no-tx-datasource>
</pre>
<br/>
it works fine. No exception occurs.<br/>
<br/>
But if i use a:<br/>
<pre>
<xa-datasource>
<jndi-name>assekuradeurDatasource</jndi-name>
<track-connection-by-tx/>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<xa-datasource-property name="ServerName">...</xa-datasource-property>
<xa-datasource-property name="PortNumber">...</xa-datasource-property>
<xa-datasource-property name="DatabaseName">...</xa-datasource-property>
<xa-datasource-property name="User">...</xa-datasource-property>
<xa-datasource-property name="Password">...</xa-datasource-property>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<min-pool-size>1</min-pool-size>
<max-pool-size>200</max-pool-size>
</xa-datasource>
</pre><br/>
<br/>
i got the following exception after printing (printed document was ok):<br/>
<br/>
<pre>
2011-02-17 11:30:57,673 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] (http-0.0.0.0-8080-1) Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@6d0faf
java.lang.Throwable: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:278)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:524)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source)
at com.crystaldecisions.reports.queryengine.JDBConnectionWrapper.Open(SourceFile:123)
at com.crystaldecisions.reports.queryengine.Connection.br(SourceFile:1771)
at com.crystaldecisions.reports.queryengine.Connection.bs(SourceFile:491)
at com.crystaldecisions.reports.queryengine.Connection.t1(SourceFile:2978)
at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.a(SourceFile:696)
at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.for(SourceFile:706)
at com.crystaldecisions.reports.reportdefinition.ReportHelper.a(SourceFile:198)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.long(SourceFile:957)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:635)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1944)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:661)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:167)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:529)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:527)
at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:525)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:424)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:352)
at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)
at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)
at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:223)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:147)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:128)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:111)
at org.sis.assekuradeur.utils.JRCHelper.print(JRCHelper.java:94)
...
2011-02-17 11:30:57,675 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] (http-0.0.0.0-8080-1) throwable from unregister connection
java.lang.IllegalStateException: Trying to return an unknown connection2! org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@6d0faf
at org.jboss.resource.connectionmanager.CachedConnectionManager.unregisterConnection(CachedConnectionManager.java:330)
at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.connectionClosed(TxConnectionManager.java:797)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:363)
at org.jboss.resource.adapter.jdbc.WrappedConnection.close(WrappedConnection.java:156)
at sun.reflect.GeneratedMethodAccessor374.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.resource.connectionmanager.CachedConnectionManager.closeConnection(CachedConnectionManager.java:523)
at org.jboss.resource.connectionmanager.CachedConnectionManager.access$000(CachedConnectionManager.java:63)
at org.jboss.resource.connectionmanager.CachedConnectionManager$CloseConnectionSynchronization.afterCompletion(CachedConnectionManager.java:603)
at org.jboss.resource.connectionmanager.TransactionSynchronizer.invokeAfter(TransactionSynchronizer.java:301)
at org.jboss.resource.connectionmanager.TransactionSynchronizer.afterCompletion(TransactionSynchronizer.java:271)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:123)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:381)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:99)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:160)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1431)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:170)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
...
</pre>
Edited by: M.Schulz on Feb 17, 2011 11:50 AM