-
1. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
swiderski.maciej Oct 13, 2011 9:48 AM (in response to diata)1 of 1 people found this helpfulHi,
check persistence.xml file settings for ddl auto generation in hibernate properties section. As far as I remember is set to create to it recreates it every time it is loaded, in your case whenever JBoss starts.
HTH
-
2. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
diata Oct 13, 2011 10:58 AM (in response to swiderski.maciej)That helped, it fixed for table for not being recreated.
However, I can see task info in WorkItemInfo table, but in jbpm console I don't see any task.
I converted DemoTaskService to a servlet so that I don't need to start another java process.
Any idea?
-
3. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
swiderski.maciej Oct 13, 2011 11:07 AM (in response to diata)A first thing that comes to my mind is that users that are (if any) in the task database don't match your console user that is logged on.
-
4. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
diata Oct 13, 2011 11:17 AM (in response to swiderski.maciej)I am using user that comes with JBPM like john, krisv, mary etc.
Which database are you referring to, because I don't see any user table in my database after switching from H2 to SQL Server.
How I do much the users in database and jbpm console.
-
5. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
swiderski.maciej Oct 13, 2011 11:32 AM (in response to diata)check organizationalentity table to see if there are any entities present that is task service schema
-
6. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
diata Oct 13, 2011 11:42 AM (in response to swiderski.maciej)After switching to sql server, jbpm hibernate code created only following tables:WorkItemInfo, NodeInstanceLog,ProcessInstanceInfo, ProcessInstanceLog, SessionInfo and EventTypes.
So the table you mentioned does not exist in my database.
What are the other tables I need?
Why all the tables were not created?
-
7. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
swiderski.maciej Oct 13, 2011 12:03 PM (in response to diata)1 of 1 people found this helpfulTables that you refer to are for jbpm runtime data. I refer to tables that are created for human task service. There are two separate persistence.xml files.
So, when you start your human task service you need to create entitiy manager factory based on persistence unit. That persistence unit defines task service schema. Please verify that it is started properly and db is created only once, I assume that you changed only jBPM runtime persistence configuration and that task service is still recreating its db schama every time JBoss is started.
P.S.
Human task service persistence.xml file is embedded in jbpm-human-tasl.jar.
-
8. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
diata Oct 13, 2011 12:14 PM (in response to swiderski.maciej)Thank you very much. I got it.
However, the persistence file for tasks are in jar. I guess I will modify jbpm-human-task-5.1.0.Final.jar which has the persistence for task. This is odd that there is no simple way to do this without messing jar files.
-
9. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
swiderski.maciej Oct 13, 2011 12:17 PM (in response to diata)It is a simple way, just make a copy of that (embedded in jar) persistence.xml file and change the persistence unit name attribute. Next use the new persistence unit name when you build entifiy manager factory while starting task service.
-
10. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
diata Oct 13, 2011 12:26 PM (in response to swiderski.maciej)Thanks, I just made new persistence unit and used that in my servlet.
-
11. Re: JBPM 5.1 and Persistense (instances get deleted after jboss restart))
diata Oct 13, 2011 12:59 PM (in response to diata)I am getting this error when I updated my persistence unit name.
java.lang.IllegalArgumentException: Named query not found: UnescalatedDeadlines