7 Replies Latest reply on Dec 6, 2012 2:22 PM by nickarls

    Getting an error in JBOSS AS 7.1

    harjitdotsingh

      Hi there,

       

       

      when I run some queries on the application which is deployed in the application server . I see this error very frequently

       

      11:41:25,145 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--0.0.0.0-8080-1) Unable to obtain lock in 60 seconds: org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@249e8fde

      11:41:25,457 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--0.0.0.0-8080-8) Unable to obtain lock in 60 seconds: org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@249e8fde

       

       

      How can I fix this ?

        • 1. Re: Getting an error in JBOSS AS 7.1
          nickarls

          More details reuquired. What DB type? persistence.xml? Datasource definition? Application structure etc...

          • 2. Re: Getting an error in JBOSS AS 7.1
            harjitdotsingh

            The Database is SQL Server. Datasource definition is as follows

             

             

            <datasource jndi-name="java:/SENTRYDATA" pool-name="SENTRYDATA" enabled="true" use-java-context="true">

                                <connection-url>jdbc:sqlserver://SQL1FC:1433;databaseName=Sentry126_RC1;DB_CLOSE_DELAY=-1</connection-url>

                                <driver>SQLDS</driver>

                                <security>

                                    <user-name></user-name>

                                    <password></password>

                                </security>

                            </datasource>

             

            Application structure is as follows

            I have a web application calling a REST BASED Service which actually does the call to the DB. Hope that helps

            • 3. Re: Getting an error in JBOSS AS 7.1
              nickarls

              JPA? Datasource @Resource injection? Are you leaving locks behind in the database?

              • 4. Re: Getting an error in JBOSS AS 7.1
                harjitdotsingh

                Here is the entry in the persistence.xml

                 

                <persistence-unit name="ceDataSessionData"

                                      transaction-type="RESOURCE_LOCAL">

                          <provider>org.hibernate.ejb.HibernatePersistence</provider>

                          <jta-data-source>java:/SENTRYDATA</jta-data-source>

                 

                and here is how I'm instansiating it

                 

                emf = Persistence.createEntityManagerFactory("ceDataSessionData");

                 

                 

                                    em = emf.createEntityManager();

                • 5. Re: Getting an error in JBOSS AS 7.1
                  nickarls

                  And after some successful operations, are there any DB locks hanging around?

                  • 6. Re: Getting an error in JBOSS AS 7.1
                    harjitdotsingh

                    No there aren't any. Here is the scenario under which it starts happening. When I send normal string to search I do see results coming back. The moment I add any wildcards to the string data. I start seeing this. When I run the stored procedure with the same parameters it works fine and doesn't take long, its only that thru the rest based service I see this error.

                    • 7. Re: Getting an error in JBOSS AS 7.1
                      nickarls

                      Tried cranking up log levels so you can see what is causing the timeout?