2 Replies Latest reply on May 3, 2006 2:24 AM by pganesh81

    java.sql.SQLException: The database is already in use by ano

      Hi,
      I tried creating a new web application for deploying a process definition in Sun server using the HSQL database. Upon execution of the method - deployProcessDefinition in a class file, it throws an SQLException shown below. Anyone please help in sorting this problem

      [#|2006-04-28T14:55:05.062+0530|WARNING|sun-appserver-pe8.2|org.hibernate.cfg.SettingsFactory|_ThreadID=11;|Could not obtain connection metadata
      java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@d6a71f16[file =D:\JBPM\jbpm-starters-kit-3.1\jbpm-server\server\jbpm\data\hypersonic\localDB.lck, exists=true, locked=false, valid=false, fl =sun.nio.ch.FileLockImpl[0:16 exclusive valid]]: java.security.AccessControlException: access denied (java.io.FilePermission D:\JBPM\jbpm-starters-kit-3.1\jbpm-server\server\jbpm\data\hypersonic\localDB.lck delete)
      at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
      at org.hsqldb.jdbc.jdbcConnection.(Unknown Source)
      at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
      at org.hsqldb.jdbcDriver.connect(Unknown Source)
      at java.sql.DriverManager.getConnection(DriverManager.java:525)
      at java.sql.DriverManager.getConnection(DriverManager.java:140)
      at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1859)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1152)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
      at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
      at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:79)
      at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:216)
      at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:427)
      at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:166)
      at UserBean.deployProcessDefinition(UserBean.java:89)

        • 1. Re: java.sql.SQLException: The database is already in use by
          kukeltje

          if the jboss/jbpm server is already running, deploying via a file based url dos not work. There can only be one. This is not a jboss/jbpm/hibernate issue, but a hsqldb.

          if you make sure one is running and listening on a port, make sure deployment is done via that port by configuring the hsqldb url.

          • 2. Re: java.sql.SQLException: The database is already in use by

            Thank You for your reply.
            However the JBPM / JBOSS server is switched off in this case. I am trying to use the file based url for the HSQL database. What else can i try to solve this problem.
            It was understood from the log output that it is some process in the execution of "deployProcessDefinition" method is locking the file. And again some other process during the execution of same method is trying to access the database.
            Is any configuration changes needed?
            Or else using some other database server could be a solution?