3 Replies Latest reply: Mar 28, 2012 1:42 PM by Ramesh Reddy RSS

How to intercept a JDBCExecutionFactory ?

Vineela Gampa Novice

I have SafetyHarnessExecutionFactory which extends BaseDelegatingExecutionFactory and catches exceptions on getConnection , closeConnection,createExecution,getMetadata. SafetyHarnessExecutionFactory catches the exception and logs them instead of throwing translator exceptions so that teiid can continue with its VDB deployment.

 

I have some trouble with executionfactories which extends JDBCExecutionFactory and which ovveride getSQLConversionVisitor() . Iam not quite sure if thats the cause , bbut apparently iam not able to continue with the deployement if there is some connection error for Executionfactories which extend JDBCExecutionFactory and has getSQLConversionVisitor

[23:14:16.139][info][talledLocalContainer] 27 Mar 2012 23:14:16,137 PDT WARN  [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null

[23:14:16.139][info][talledLocalContainer] org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.reflect.UndeclaredThrowableException)

[23:14:16.139][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)

[23:14:16.139][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)

[23:14:16.139][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)

[23:14:16.139][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)

[23:14:16.140][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)

[23:14:16.140][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)

[23:14:16.140][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)

[23:14:16.140][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)

[23:14:16.140][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

[23:14:16.140][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)

[23:14:16.140][info][talledLocalContainer]     at org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:255)

[23:14:16.140][info][talledLocalContainer]     at org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:83)

[23:14:16.140][info][talledLocalContainer]     at org.teiid.translator.ExecutionFactory.getConnection(ExecutionFactory.java:184)

[23:14:16.140][info][talledLocalContainer]     at org.teiid.translator.BaseDelegatingExecutionFactory.getConnection(BaseDelegatingExecutionFactory.java:112)

[23:14:16.140][info][talledLocalContainer]     at com.ca.chorus.teiid.safety.SafetyHarnessExecutionFactory.getConnection(SafetyHarnessExecutionFactory.java:79)

[23:14:16.141][info][talledLocalContainer]     at org.teiid.dqp.internal.datamgr.ConnectorManager.getMetadata(ConnectorManager.java:121)

[23:14:16.141][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.loadMetadata(VDBDeployer.java:354)

[23:14:16.141][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.access$000(VDBDeployer.java:60)

[23:14:16.141][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer$1.run(VDBDeployer.java:320)

[23:14:16.141][info][talledLocalContainer]     at org.jboss.util.threadpool.RunnableTaskWrapper.run(RunnableTaskWrapper.java:147)

[23:14:16.141][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

[23:14:16.141][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

[23:14:16.141][info][talledLocalContainer]     at java.lang.Thread.run(Thread.java:722)

[23:14:16.141][info][talledLocalContainer] Caused by: java.lang.reflect.UndeclaredThrowableException

[23:14:16.141][info][talledLocalContainer]     at org.jboss.resource.JBossResourceException.process(JBossResourceException.java:206)

[23:14:16.141][info][talledLocalContainer]     at org.jboss.resource.JBossResourceException.<init>(JBossResourceException.java:113)

[23:14:16.141][info][talledLocalContainer]     ... 23 more

[23:14:16.142][info][talledLocalContainer] Caused by: java.lang.UnsatisfiedLinkError: no cadcdb64 in java.library.path

[23:14:16.142][info][talledLocalContainer]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)

[23:14:16.142][info][talledLocalContainer]     at java.lang.Runtime.loadLibrary0(Runtime.java:845)

[23:14:16.142][info][talledLocalContainer]     at java.lang.System.loadLibrary(System.java:1084)

[23:14:16.142][info][talledLocalContainer]     at ca.datacom.db.Jni.<clinit>(Unknown Source)

[23:14:16.142][info][talledLocalContainer]     at ca.datacom.db.Node.connect(Unknown Source)

[23:14:16.142][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomConnection.open(Unknown Source)

[23:14:16.142][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomJdbcDriver.connect(Unknown Source)

[23:14:16.142][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)

[23:14:16.142][info][talledLocalContainer]     ... 22 more

[23:14:18.653][info][talledLocalContainer] 27 Mar 2012 23:14:18,653 PDT INFO  [RUNTIME] VDB Chorus.1 model h2util metadata is currently being loaded.

  • 1. Re: How to intercept a JDBCExecutionFactory ?
    Ramesh Reddy Master

    JDBCExecutionfactory needs a *valid* connection to retrieve the metadata in Dynamic  VDB scenarios, with out this the VDB deployment will be incomplete. So, override and implement accordingly.

     

    The actual error above is from the your "DatacomJDBCDriver" not finding a .DLL or .SO file that is needed for the JDBC driver to work, so check and install those libraries before you try to create connection.

     

    Ramesh..

  • 2. Re: How to intercept a JDBCExecutionFactory ?
    Vineela Gampa Novice

    Hi Ramesh,

     

    The samething happens even if it fails to connect to JDBC driver.

     

    [09:45:48.701][info][talledLocalContainer] 28 Mar 2012 09:45:48,695 PDT WARN  [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null

    [09:45:48.701][info][talledLocalContainer] org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: IO error sending or receiving native data: ca.datacom.db.DBIOException: CCICONV FAILURE: CCI9006 No Receiver online                                     in Session(connect))

    [09:45:48.701][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)

    [09:45:48.701][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)

    [09:45:48.701][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)

    [09:45:48.701][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)

    [09:45:48.701][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)

    [09:45:48.701][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)

    [09:45:48.701][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)

    [09:45:48.702][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)

    [09:45:48.702][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

    [09:45:48.702][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)

    [09:45:48.702][info][talledLocalContainer]     at org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:255)

    [09:45:48.702][info][talledLocalContainer]     at org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:83)

    [09:45:48.702][info][talledLocalContainer]     at org.teiid.translator.ExecutionFactory.getConnection(ExecutionFactory.java:184)

    [09:45:48.702][info][talledLocalContainer]     at org.teiid.translator.BaseDelegatingExecutionFactory.getConnection(BaseDelegatingExecutionFactory.java:112)

    [09:45:48.702][info][talledLocalContainer]     at com.ca.chorus.teiid.safety.SafetyHarnessExecutionFactory.getConnection(SafetyHarnessExecutionFactory.java:79)

    [09:45:48.702][info][talledLocalContainer]     at org.teiid.dqp.internal.datamgr.ConnectorManager.getMetadata(ConnectorManager.java:121)

    [09:45:48.702][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.loadMetadata(VDBDeployer.java:354)

    [09:45:48.703][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.access$000(VDBDeployer.java:60)

    [09:45:48.703][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer$1.run(VDBDeployer.java:320)

    [09:45:48.703][info][talledLocalContainer]     at org.jboss.util.threadpool.RunnableTaskWrapper.run(RunnableTaskWrapper.java:147)

    [09:45:48.703][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

    [09:45:48.703][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

    [09:45:48.703][info][talledLocalContainer]     at java.lang.Thread.run(Thread.java:722)

    [09:45:48.703][info][talledLocalContainer] Caused by: java.sql.SQLException: IO error sending or receiving native data: ca.datacom.db.DBIOException: CCICONV FAILURE: CCI9006 No Receiver online                                     in Session(connect)

    [09:45:48.703][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomJdbcObject.getSQLException(Unknown Source)

    [09:45:48.703][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomConnection.open(Unknown Source)

    [09:45:48.703][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomJdbcDriver.connect(Unknown Source)

    [09:45:48.704][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)

    [09:45:48.704][info][talledLocalContainer]     ... 22 more

    [09:45:48.704][info][talledLocalContainer] 28 Mar 2012 09:45:48,695 PDT WARN  [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null

    [09:45:48.704][info][talledLocalContainer] org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: IO error sending or receiving native data: ca.datacom.db.DBIOException: CCICONV FAILURE: CCI9032 Remote resource path unavailable                       in Session(connect))

    [09:45:48.704][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)

    [09:45:48.704][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)

    [09:45:48.704][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)

    [09:45:48.704][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)

    [09:45:48.704][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)

    [09:45:48.704][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)

    [09:45:48.705][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)

    [09:45:48.705][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)

    [09:45:48.705][info][talledLocalContainer]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

    [09:45:48.705][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)

    [09:45:48.705][info][talledLocalContainer]     at org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:255)

    [09:45:48.705][info][talledLocalContainer]     at org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:83)

    [09:45:48.705][info][talledLocalContainer]     at org.teiid.translator.ExecutionFactory.getConnection(ExecutionFactory.java:184)

    [09:45:48.705][info][talledLocalContainer]     at org.teiid.translator.BaseDelegatingExecutionFactory.getConnection(BaseDelegatingExecutionFactory.java:112)

    [09:45:48.705][info][talledLocalContainer]     at com.ca.chorus.teiid.safety.SafetyHarnessExecutionFactory.getConnection(SafetyHarnessExecutionFactory.java:79)

    [09:45:48.705][info][talledLocalContainer]     at org.teiid.dqp.internal.datamgr.ConnectorManager.getMetadata(ConnectorManager.java:121)

    [09:45:48.705][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.loadMetadata(VDBDeployer.java:354)

    [09:45:48.706][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.access$000(VDBDeployer.java:60)

    [09:45:48.706][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer$1.run(VDBDeployer.java:320)

    [09:45:48.706][info][talledLocalContainer]     at org.jboss.util.threadpool.RunnableTaskWrapper.run(RunnableTaskWrapper.java:147)

    [09:45:48.706][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

    [09:45:48.706][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

    [09:45:48.706][info][talledLocalContainer]     at java.lang.Thread.run(Thread.java:722)

    [09:45:48.706][info][talledLocalContainer] Caused by: java.sql.SQLException: IO error sending or receiving native data: ca.datacom.db.DBIOException: CCICONV FAILURE: CCI9032 Remote resource path unavailable                       in Session(connect)

    [09:45:48.706][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomJdbcObject.getSQLException(Unknown Source)

    [09:45:48.706][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomConnection.open(Unknown Source)

    [09:45:48.706][info][talledLocalContainer]     at ca.datacom.jdbc.DatacomJdbcDriver.connect(Unknown Source)

    [09:45:48.706][info][talledLocalContainer]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)

  • 3. Re: How to intercept a JDBCExecutionFactory ?
    Ramesh Reddy Master

    Vineela,

     

    "getSQLConversionVisitor" method is not on the "ExecutionFactory" class, which BaseDelegatingExecutionFactory implements. This method is on "JDBCExecutionFactory". if you want to intercept that, then you need to write your own BaseDelegatingExecutionFactory that extends the "JDBCExecutionFactory" class.

     

    Ramesh.