2 Replies Latest reply on Mar 16, 2017 11:00 AM by Simon Prinz

    Various Errors when using DB persistence with ModeShape 5.3.0

    Simon Prinz Newbie

      Hi,

       

      thanks for fixing MODE-2676 so fast!

       

      We ran into another problem:

      Until now we used file persistence with modeshape 4.6.2. After updating to 5.3.0 we are now using db persistence with a PostgreSQL db for clustering purposes.

       

      Everything runs fine for a while but after some time we start seeing the following messages in our logs:

       

      [EL Warning]: 2017-03-16 10:44:16.274--UnitOfWork(898654199)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException

      Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "iam_v_usersession_service" does not exist

        Position: 13

      Error Code: 0

      Call: DELETE FROM IAM_V_USERSESSION_SERVICE WHERE ((session_oid = ?) AND (SERVICE_INSTANCE_KEY = ?))

          bind => [2 parameters bound]

      Query: DeleteAllQuery(referenceClass=UserSessionServicePersistenceDMO sql="DELETE FROM IAM_V_USERSESSION_SERVICE WHERE ((session_oid = ?) AND (SERVICE_INSTANCE_KEY = ?))")

      [EL Warning]: 2017-03-16 10:44:30.786--UnitOfWork(779758188)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException

      Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "iam_v_right" does not exist

        Position: 24

      Error Code: 0

      Call: SELECT MAX(MDATE) FROM IAM_V_RIGHT

      Query: ReportQuery(referenceClass=RightPersistenceDMO sql="SELECT MAX(MDATE) FROM IAM_V_RIGHT")

      [EL Warning]: 2017-03-16 10:45:16.281--UnitOfWork(280521944)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException

      Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "iam_v_usersession_service" does not exist

        Position: 13

      Error Code: 0

      Call: DELETE FROM IAM_V_USERSESSION_SERVICE WHERE ((session_oid = ?) AND (SERVICE_INSTANCE_KEY = ?))

          bind => [2 parameters bound]

      Query: DeleteAllQuery(referenceClass=UserSessionServicePersistenceDMO sql="DELETE FROM IAM_V_USERSESSION_SERVICE WHERE ((session_oid = ?) AND (SERVICE_INSTANCE_KEY = ?))")

      [EL Warning]: 2017-03-16 10:45:30.793--UnitOfWork(1108956784)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException

      Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "iam_v_right" does not exist

        Position: 24

      Error Code: 0

      Call: SELECT MAX(MDATE) FROM IAM_V_RIGHT

      Query: ReportQuery(referenceClass=RightPersistenceDMO sql="SELECT MAX(MDATE) FROM IAM_V_RIGHT")

       

       

      There seems to be a problem in finding certain tables or views in the database, which are definitly there. When using file persistance, our software works normally and finds every table in the db. At first we suspected that modeshape blocks our applications queries and that it needs a separate connection to the db. However, we used the following two configurations and neither one worked:

       

      "storage" : {

             "persistence" : {

                  "type" : "db",

                  "dataSourceJndiName" : "osgi:service/jdbc/servicecomponents"

             }

             ...

      }

       

      and

       

      "persistence" : {

                 "type" : "db",

                 "driver" : "org.postgresql.Driver",

                 "connectionUrl" : "jdbc:postgresql://fdhpe02:5432/db",

                 "username" : "username",

                 "password" : "pw"

            }

            ...

      }

       

      For the second case we also used a JDBC 4 compliant driver in our classpath:

       

      <dependency>

               <groupId>org.postgresql</groupId>

               <artifactId>postgresql</artifactId>

               <version>9.3-1102-jdbc41</version>

               <scope>provided</scope>

                <type>jar<type>

      </dependency>

       

       

      Your help would be muc appreciated!

       

      Greetings,

      Simon Prinz