1 Reply Latest reply on Jul 14, 2004 6:44 AM by darranl

    error:

    iliev

      Hi !!!

      i'm a newby with JBoss, so i'm testing it by executing the Gangster ReadAheadTest, supplied with the buied documentation.

      I'm using for this test postgreSQL and i need to keep no more than 4 connection (later in production i'm forced to use Microsoft Desktop Engine)
      This i my postgres-ds.xml :


      <datasources>
       <local-tx-datasource>
       <jndi-name>PostgresDS</jndi-name>
       <connection-url>jdbc:postgresql://192.168.10.17:5432/gangster</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>postgres</user-name>
       <password></password>
       <min-pool-size>2</min-pool-size>
       <max-pool-size>4</max-pool-size>
       <idle-timeout-minutes>1</idle-timeout-minutes>
       </local-tx-datasource>
      </datasources>


      I've put 500 gangster in gangster table, then for test purpose i've launched 8 process testing the application, in this way:

      ant readhead &
      ant readhead &
      ant readhead &
      ant readhead &
      ant readhead &
      ant readhead &
      ant readhead &
      ant readhead &


      the last process invoked by ant will produce the following error

      java.lang.Exception: org.jboss.util.NestedSQLException:
      No ManagedConnections available within configured blocking timeout ( 30000 [ms] );
      - nested throwable: (javax.resource.ResourceException:
      No ManagedConnections available within configured blocking timeout ( 10000 [ms] )):
      Get Access Level from Database error!


      So i've added the following line to my postgres-ds.xml:

      <blocking-timeout-millis>3600000</blocking-timeout-millis>


      Then i've relaunched the test, but, during execution of last test (read-ahead with user transaction) four of the eight test process
      fail with this error:

      18:19:49,549 ERROR [LogInterceptor] EJBException, causedBy:
      org.jboss.util.NestedSQLException:
      Interrupted while requesting permit! Waited 214326 ms, invocation time: 1089735589522; - nested throwable:
      (javax.resource.ResourceException: Interrupted while requesting permit! Waited 214326 ms, invocation time: 1089735589522)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)

      Are userTransaction, used in this way:

      public String createGangsterHtmlTable_with_tx() throws FinderException {
       UserTransaction tx = null;
       try {
       InitialContext ctx = new InitialContext();
       tx = (UserTransaction) ctx.lookup("UserTransaction");
       tx.begin();
      
       String table = createGangsterHtmlTable_no_tx();
      
       if(tx.getStatus() == Status.STATUS_ACTIVE) {
       tx.commit();
       }
       ...


      blocking my connection ?
      Can anyone help me, or suggest another user transaction usage ?

      Thanks
      alessandro.zambonelli@kirio.it

        • 1. error:
          darranl

          Hi !!!

          i'm a newby with JBoss, so i'm testing it by executing the Gangster ReadAheadTest, supplied with the buied documentation.

          I'm using for this test postgreSQL and i need to keep no more than 4 connection (later in production i'm forced to use Microsoft Desktop Engine)
          This i my postgres-ds.xml :


          <datasources>
           <local-tx-datasource>
           <jndi-name>PostgresDS</jndi-name>
           <connection-url>jdbc:postgresql://192.168.10.17:5432/gangster</connection-url>
           <driver-class>org.postgresql.Driver</driver-class>
           <user-name>postgres</user-name>
           <password></password>
           <min-pool-size>2</min-pool-size>
           <max-pool-size>4</max-pool-size>
           <idle-timeout-minutes>1</idle-timeout-minutes>
           </local-tx-datasource>
          </datasources>


          I've put 500 gangster in gangster table, then for test purpose i've launched 8 process testing the application, in this way:

          ant readhead &
          ant readhead &
          ant readhead &
          ant readhead &
          ant readhead &
          ant readhead &
          ant readhead &
          ant readhead &


          the last process invoked by ant will produce the following error

          java.lang.Exception: org.jboss.util.NestedSQLException:
          No ManagedConnections available within configured blocking timeout ( 30000 [ms] );
          - nested throwable: (javax.resource.ResourceException:
          No ManagedConnections available within configured blocking timeout ( 10000 [ms] )):
          Get Access Level from Database error!


          So i've added the following line to my postgres-ds.xml:

          <blocking-timeout-millis>3600000</blocking-timeout-millis>


          Then i've relaunched the test, but, during execution of last test (read-ahead with user transaction) four of the eight test process
          fail with this error:

          18:19:49,549 ERROR [LogInterceptor] EJBException, causedBy:
          org.jboss.util.NestedSQLException:
          Interrupted while requesting permit! Waited 214326 ms, invocation time: 1089735589522; - nested throwable:
          (javax.resource.ResourceException: Interrupted while requesting permit! Waited 214326 ms, invocation time: 1089735589522)
           at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)

          Are userTransaction, used in this way:

          public String createGangsterHtmlTable_with_tx() throws FinderException {
           UserTransaction tx = null;
           try {
           InitialContext ctx = new InitialContext();
           tx = (UserTransaction) ctx.lookup("UserTransaction");
           tx.begin();
          
           String table = createGangsterHtmlTable_no_tx();
          
           if(tx.getStatus() == Status.STATUS_ACTIVE) {
           tx.commit();
           }
           ...


          blocking my connection ?
          Can anyone help me, or suggest another user transaction usage ?

          Thanks
          alessandro.zambonelli@kirio.it