5 Replies Latest reply on Jun 13, 2016 2:38 PM by rareddy

    Odata call to JBOSS DV Teiid VDB giving empty response intermittently

    rohit.wadhwa

      Here comes the odata url which I am trying to hit from RestClient/Postman:

      http://localhost:8181/odata/TestVDB/Tracking.TEST_TRACKER?$format=json&$filter=REQUEST_ID eq '349cb1d7-09d0'

       

      It should ideally return me 3-5 records of the table. When I call this url for the first time, I get the response as desired but as I hit the url again consecutively, I get empty response.

      Calling the url after few minutes of gap again gives the required response.

       

      -->Query is a simple select query and behavior is fine when executed in DB

      -->REQUEST_ID is not a primary key. TRACKER_ID is primary key in the table but our requirement is to execute the query based on REQUEST_ID.

      -->Exception retrieved in logs is as follows:

      17:38:45,959 INFO [org.teiid.CONNECTOR] (http-localhost/127.0.0.1:8181-1) OracleExecutionFactory Commit=true;DatabaseProductName=Oracle;DatabaseProductVersion=Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

      With the Partitioning, OLAP, Data Mining and Real Application Testing options;DriverMajorVersion=11;DriverMajorVersion=2;DriverName=Oracle JDBC driver;DriverVersion=11.2.0.2.0;IsolationLevel=2

      17:38:46,673 INFO [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (http-localhost/127.0.0.1:8181-1) IJ000311: Throwable from unregister connection: java.lang.IllegalStateException: Trying to return an unknown connection2! org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@31626316

       

       

      Here comes the standalone.xml for the data source & VDB which I am trying to access:

       

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

      <connection-url>jdbc:oracle:thin:@localhost:1521:NEES</connection-url>

      <driver>ojdbc6.jar</driver>

      <security>

      <user-name>hr</user-name>

      <password>hr</password>

      </security>

      <pool>

      <min-pool-size>15</min-pool-size>

      <max-pool-size>100</max-pool-size>

      <prefill>true</prefill>

      </pool>

      <timeout>

      <blocking-timeout-millis>5000000</blocking-timeout-millis>

      <idle-timeout-minutes>30</idle-timeout-minutes>

      </timeout>

      <statement>

      <track-statements>true</track-statements>

      <prepared-statement-cache-size>10</prepared-statement-cache-size>

      </statement>

      </datasource>

       

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

      <connection-url>jdbc:teiid:TestVDB@mm://localhost:31000</connection-url>

      <driver>teiid</driver>

      <security>

      <user-name>TestUser</user-name>

      <password>Test@123</password>

      </security>

      </datasource>

       

       

       

      Making odata call for the first time, response is as follows:

      {

        "d": {

          "results": [

            {

      "__metadata": {

      "uri": "http://localhost:8181/odata/TestVDB/TEST_TRACKER(59325M)",

      "type": "Tracking.TEST_TRACKER"

              },

      "TRACKER_ID": "59325",

      "QUEUE_WORK": "VIRUS",

      "REQUEST_ID": "349cb1d7-09d0",

      "STATUS": "SUCCESS"

             

            },

            {

      "__metadata": {

      "uri": "http://localhost:8181/odata/TestVDB/TEST_TRACKER(59326M)",

      "type": "Tracking.TEST_TRACKER"

              },

      "TRACKER_ID": "59326",

      "QUEUE_WORK": "VDB",

      "REQUEST_ID": "349cb1d7-09d0",

      "STATUS": "IN_QUEUE"

            }

          ]

        }

      }

       

      Subsequently making the odata call again gives response as follows:

      {

        "d": {

          "results": []

        }

      }

       

      Making the same call after a gap of few minutes return the response correctly. Why does it miss out the response in consecutive calls ?