5 Replies Latest reply on May 27, 2014 7:15 PM by shawkins

    Teiid JNDI sql server connection settings - implicit_transactions  OFF and persistent connection

    lightsailpro

      I am testing the database connection using the Microsoft sqljdbc4 driver. I noticed that teiid uses the following connection settings by default:

           transaction isolation level read committed

           implicit_transactions on

      I want to change them to so that I do not need to worry about the blocking.

           set transaction isolation level read uncommitted

           set implicit_transactions off


      1. Teiid designer does not support changing these settings. So I modified the data source in the standalone_teiid.xml file as below. But from SQL server profiler, it still uses the default settings. Does anyone know where to override the default connection setting? By the way applicationIntent=ReadOnly is for the SQL 2012 HA.


      <datasource jndi-name="java:/AdventureWorks" pool-name="AdventureWorks" enabled="true">

            <connection-url>jdbc:sqlserver://server1:1433;databaseName=AdventureWorks2012;applicationIntent=ReadOnly;InitializationString=set transaction isolation level read uncommitted;</connection-url>

                          <driver>sqljdbc4.jar</driver>

                          <security>

                              <user-name>user1</user-name>

                              <password>xxxxx</password>

                          </security>

      </datasource>

       

      2. After I disconnect connection (e.g.SQL workbenchfrom Teiid, I noticed that Teiid runtime still have a connection on the SQL server. Why Teiid still hold the connection after client application disconnects? Is it because Teiid uses connection pooling? If yes, is there a way to turn off? Will Teiid ever release the connection at all?

       

      3. By this MS doc - http://docs.oracle.com/cd/E13157_01/wlevs/docs30/jdbc_drivers/mssqlserver.html, we can set multiple options for the InitializationString parameter, but if I do that, teiid will not run. Could someone advise if this is possible in Teiid? As I mentioned, I mainly use Teiid for data warehousing type of read. The default settings can cause performance issue on SQL server.

       

      InitializationString=(set transaction isolation level read uncommitted;set implicit_transactions off);

       

      Thanks in advance.

        • 1. Re: Teiid JNDI sql server connection settings - implicit_transactions  OFF and persistent connection
          shawkins

          > Does anyone know where to override the default connection setting?


          What you have looks correct.  If you are getting your connections through that datasource (and not for example seeing the connection that is being made in Designer to read metadata) and you don't see that connection url being used then we should determine what is happening there first.

           

          > Is it because Teiid uses connection pooling?

           

          When you configure a datasource it is a connection pool.  This is at the application server level and effectively independent of Teiid.  The datasource configuration can also include min/max connections, etc.

           

          > If yes, is there a way to turn off? Will Teiid ever release the connection at all?

           

          I suppose you could set max connections to 0, but that I don't think that's what you should do.  The Teiid layer should not be the one that is causing the connection to remain open as connections are returned to the pool as soon as possible.

           

          > teiid will not run.

           

          Can you be specific as to what you mean here?

           

          > Could someone advise if this is possible in Teiid?

           

          Yes that should be possible in the datasource configuration.

          • 2. Re: Teiid JNDI sql server connection settings - implicit_transactions  OFF and persistent connection
            lightsailpro

            Hi, Steven:

            --The connection actually observed and used by teiid  is through the data source defined in the standalone_teiid.xml, it is not through the teiid designer. So I assume Teiid runtime just ignores certain settings or does not pass to the sqljdbc4 driver layer. Is this a bug?

            --When I added "InitializationString=(set transaction isolation level read uncommitted;set implicit_transactions off);", the teiid server will not start. If I just added one without parensis, it starts but just ignore the setting.

             

            I have to use the Microsoft jdbc driver for the HA readonly routing. But I also need to set a few other connection settings ( uncommitted;set implicit_transactions, transaction isolation level, applicationIntent). Did anyone tried these settings before?

             

            Thanks again.

            • 3. Re: Teiid JNDI sql server connection settings - implicit_transactions  OFF and persistent connection
              shawkins

              > So I assume Teiid runtime just ignores certain settings or does not pass to the sqljdbc4 driver layer. Is this a bug?

               

              Just to clarify it's not Teiid that is in control of the connection pools, that is a function of JBoss AS / JCA.  I cannot say if it's a bug.  If you see behavior which looks incorrect then you can make a post on the AS forum or go straight to logging an issue against JBoss AS.

               

              > the teiid server will not start

               

              Can you clarify what this means?  Does the application server fail to start?  Does the vdb fail to deploy properly? etc.

               

              > Did anyone tried these settings before?

               

              Your best bet is to ask that on the AS forum.

              • 4. Re: Teiid JNDI sql server connection settings - implicit_transactions  OFF and persistent connection
                lightsailpro

                By "> the teiid server will not start", I mean the application server error out. It seems that it cannot parse the "(". Thanks.

                • 5. Re: Teiid JNDI sql server connection settings - implicit_transactions  OFF and persistent connection
                  shawkins

                  Can you show the xml that you are using?  Perhaps there are escapes missing.