Bug 780732 (SOA-3187)

Summary: Exception when creating jBPM database
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Jiri Pechanec <jpechane>
Component: JBossESB, JBPM - within SOA, EDSAssignee: Van Halbert <vhalbert>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.2.0dev2, 5.2.0 ER1CC: jcoleman, jsedlace
Target Milestone: ---   
Target Release: 5.2.0 GA, 5.2.0.ER2   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-3187
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
PostgreSQL 8.3, EDS installed
Last Closed: 2011-10-07 07:07:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Pechanec 2011-07-19 13:21:29 UTC
project_key: SOA

When starting DEV2  configured for PostgreSQL then an exception is thrown
15:22:57,590 ERROR [AbstractKernelController] Error installing to Start: name=jboss.esb:service=JBPMDatabaseInitializer state=Create mode=Manual requiredState=Installed
org.postgresql.util.PSQLException: ERROR: relation "hibernate_sequence" already exists
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)


The reason is the jUDDI and ModeShape now uses Hibernate for persistence too and during jUDDI or ModeShape  db setup the sequence in question is created. Then jBPM SQL scripts tries to create sequence too and fails.

Comment 1 Jiri Pechanec 2011-07-19 13:21:30 UTC
Link: Added: This issue Cloned from SOA-1599


Comment 2 Jiri Sedlacek 2011-07-22 11:16:26 UTC
The same or similar for oracle11gR2

2011-07-22 06:04:24,625 DEBUG [org.jboss.internal.soa.esb.dependencies.DatabaseInitializer] Starting failed jboss.esb:service=JBPMDatabaseInitializer
java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:999)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
        at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1822)
        at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1787)
        at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:280)
        at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:249)
        at org.jboss.internal.soa.esb.dependencies.DatabaseInitializer.executeSql(DatabaseInitializer.java:145)
        at org.jboss.internal.soa.esb.dependencies.DatabaseInitializer.initDatabase(DatabaseInitializer.java:122)
        at org.jboss.internal.soa.esb.dependencies.DatabaseInitializer.startService(DatabaseInitializer.java:159)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)


Comment 3 Van Halbert 2011-08-03 13:36:15 UTC
Link: Added: This issue depends MODE-1231


Comment 4 Randall Hauch 2011-08-03 14:51:29 UTC
Link: Added: This issue depends MODE-1233


Comment 5 Randall Hauch 2011-08-03 14:54:59 UTC
Link: Removed: This issue depends MODE-1233 


Comment 6 Randall Hauch 2011-08-03 14:56:00 UTC
Link: Added: This issue relates to MODE-1233


Comment 7 Julian Coleman 2011-08-08 11:15:15 UTC
jBPM database initialisation modified with revision 9652 of:

  soa-p/src/main/assembly/soa.zip.xml
  soa-p/src/main/patches/jbpm/overlay_database_sql.xml
  soa-p/src/main/resources/soa-p/schema-tool/build.xml
  soa-p/src/main/resources/soa-p/schema-tool/oracle10g/template/jbpm-service.xml
  soa-p/src/main/resources/soa-p/schema-tool/oracle11g/template/jbpm-service.xml
  soa-p/src/main/resources/soa-p/schema-tool/postgresql824/template/jbpm-service.xml
  soa-p/src/main/resources/soa-p/schema-tool/postgresql837/template/jbpm-service.xml
  soa-p/src/main/resources/soa-p/schema-tool/postgresql84/template/jbpm-service.xml

Commit message:

  SOA-3187
  Split the creation of the sequence "hibernate_sequence" from the rest of the
  database table creation.
  This allows jBPM database initialisation to co-exist with other projects that
  also use this sequence.
  Modify the schema tool to copy in a new jbpm-service.xml, if it is present.
  Based on work by kconner@.


Comment 8 Van Halbert 2011-08-09 17:55:31 UTC
For ModeShape, and based on my discussion with K. Conner, the ddl scripts will have the create/drop ddl's for hibernate_sequence be split out into its own file and documented to indicate that the create or drop of the sequence should not be run if jpbm is being used on this server or cluster of servers.

Comment 10 David Le Sage 2011-08-26 05:24:12 UTC
Release Notes Docs Status: Added: Not Required
Writer: Added: dlesage


Comment 11 Jiri Pechanec 2011-10-07 07:07:26 UTC
Verified in ER4

Comment 12 JBoss JIRA Server 2014-01-07 17:46:06 UTC
Randall Hauch <rhauch> updated the status of jira MODE-1233 to Closed