Cannot insert null into table error while starting a process
singhjess Jul 5, 2012 10:57 AMHi all , we are using JBPM 5.3 on Jboss 7.1 with Hibernate 4 and using JBoss's transaciton manager and seam managed persistence context, when I try to start a process I get the following error
08:53:14,876 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) SQL Error: 23502, SQLState: 23502
08:53:14,878 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) NULL not allowed for column "INSTANCEID"; SQL statement:
insert into ProcessInstanceInfo (InstanceId, id, lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK) values (null, ?, ?, ?, ?, ?, ?, ?, ?) [23502-161]
08:53:14,888 ERROR [org.drools.persistence.SingleSessionCommandService] (http-localhost-127.0.0.1-8080-1) Could not commit session:
public void
try
KnowledgeBase kbase = readKnowledgeBase();
TransactionManager manager = (TransactionManager) new InitialContext().lookup("java:jboss/TransactionManager"
EntityManagerFactory emf = Persistence.createEntityManagerFactory( "main"
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY
env.set(EnvironmentName.GLOBALS, new
MapGlobalResolver());
env.set(EnvironmentName.APP_SCOPED_ENTITY_MANAGER, entityManager
env.set(EnvironmentName.TRANSACTION_MANAGER
Map<String, Object> params = new
params.put("name", "Arthur"
params.put("money"
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null
int
System.out
ksession.startProcess( "process_1"
ksession.dispose();
} catch
t.printStackTrace();
}
Here is my persistence.xml
<
persistence xmlns=