Customer Portal

How to define threadSafeConnection=false in JNDI

Comments 5

  • Avatar
    admin
    0
    Comment actions Permalink
    Hi varkashy,

    "threadSafeConnection=false" in database connection definition means: "all components share one JDBC connection". So from connection definition only one JDBC connection is instantiated. When set to true, each component gets own instantiated JDBC connection.

    If you set connection via JNDI, CloverETL has no chance to "clone" this connection. So it basically works in "threadSafeConnection=false" mode automatically.

    I hope this helps.
  • Avatar
    varkashy
    0
    Comment actions Permalink
    Yes that was my idea too but this doesnt seem to working
    if i dont define threadSafeConnection=false in config file language trabsformations for etl graphs is failing.
  • Avatar
    varkashy
    0
    Comment actions Permalink
    I thought same. But its now working for me. Basically its creating new connection everytime.
    Is there a way to define thread safe =false in JNDI?
    Or will it work if i use implicit caching at set connection =1?
  • Avatar
    mvarecha
    0
    Comment actions Permalink
    Hi varkashy,

    attribute "threadSafeConnection" is independent of the way how clover obtains DB connections.
    Thus you can configure JNDI Datasource in your app-container e.g. like this:

    <Resource name="jdbc/db" auth="container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClasName="oracle.jdbc.driver.OracleDriver"
    factory="oracleSourceFactory"
    user="xxx"
    password="xxx"
    url="xxxx" />
    The JNDI Datasource defined on app-container level specifies HOW the connection is created when the clover asks for it.

    However the clover DB connection config specifies how clover handle the obtained connection, so you can set the threadSafeConnection="false" there.
    it may look e.g. like this:
    <Connection id="JDBC0" jdbcSpecific="ORACLE" jndiName="java:comp/env/jdbc/db" name="jndiDBConn" type="JDBC" threadSafeConnection="false" />
    (if it's external config, it may be .cfg file with corresponding keys)
  • Avatar
    varkashy
    0
    Comment actions Permalink
    Thank You

    This option works.
    I was just looking for a way to define this in XML..

Please sign in to leave a comment.