[JBoss jBPM] - PROBLEM WITH BPEL USING JBPM_TIMER WHEN JBOSS IS RESTARTED
by afzal34
Hello,
I am using a BPEL process which has a PICK element with <onAlarm for="'PT15M'">. Once process is intiated the BPEL process inserts record to JBPM_TIMER table with appropriate DUEDATE_. Under normal circumstances the process runs fine. But if process in not completed with record still in JBPM_TIMER , and I restart the Jboss application server the next time when the pick wakes up on timer I get the exception from Hibernate saying that deadlock situation in database. I am under impression here the jboss is caching the timer in memory and trying to update two timers.
Here is my environment and exception stackTrace any help is appreciated.
JBOSS : 4.0.3 SP1
DB - SYBASE 12.5
JBPM_BPEL -- BETA 2
thank you
Afzal
Caused by: org.jbpm.graph.def.DelegationException
at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:352) at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346) at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.raiseException() at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346) at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.raiseException() at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346) at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.raiseException() at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346) at org.jbpm.bpel.def.Activity.enter(Activity.java:106) at org.jbpm.bpel.def.Activity$$FastClassByCGLIB$$a89e54a2.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.StructuredActivity$End$$EnhancerByCGLIB$$756f66da.enter()
at org.jbpm.graph.def.Transition.take(Transition.java:119) at org.jbpm.graph.def.Node.leave(Node.java:383)
at org.jbpm.bpel.def.Activity.leave(Activity.java:171) at org.jbpm.bpel.def.Activity$$FastClassByCGLIB$$a89e54a2.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.StructuredActivity$End$$EnhancerByCGLIB$$756f66da.leave() at org.jbpm.bpel.def.StructuredActivity.leave(StructuredActivity.java:60) at org.jbpm.bpel.def.StructuredActivity$End.execute(StructuredActivity.java:243)
at org.jbpm.bpel.def.Activity.enter(Activity.java:101) ... 382 more
Caused by: org.jbpm.graph.def.DelegationException at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:352) at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346) at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.raiseException() at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346) at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.raiseException() at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346) at org.jbpm.bpel.def.Activity.enter(Activity.java:106) at org.jbpm.bpel.def.Activity$$FastClassByCGLIB$$a89e54a2.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.StructuredActivity$End$$EnhancerByCGLIB$$756f66da.enter()
at org.jbpm.graph.def.Transition.take(Transition.java:119) at org.jbpm.graph.def.Node.leave(Node.java:383)
at org.jbpm.bpel.def.Activity.leave(Activity.java:171) at org.jbpm.bpel.def.Activity$$FastClassByCGLIB$$a89e54a2.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.StructuredActivity$End$$EnhancerByCGLIB$$756f66da.leave() at org.jbpm.bpel.def.StructuredActivity.leave(StructuredActivity.java:60) at org.jbpm.bpel.def.Activity$$FastClassByCGLIB$$a89e54a2.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.leave() at org.jbpm.bpel.def.StructuredActivity$End.execute(StructuredActivity.java:243)
at org.jbpm.bpel.def.Activity.enter(Activity.java:101)
... 396 more
Caused by: java.lang.NullPointerException
at org.jbpm.bpel.exe.ScopeInstance.completed(ScopeInstance.java:89) at org.jbpm.bpel.exe.ScopeInstance$$FastClassByCGLIB$$9f4730a3.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.exe.ScopeInstance$$EnhancerByCGLIB$$4a30b613.completed() at org.jbpm.bpel.def.Activity.leave(Activity.java:180) at org.jbpm.bpel.def.Activity$$FastClassByCGLIB$$a89e54a2.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.StructuredActivity$End$$EnhancerByCGLIB$$756f66da.leave() at org.jbpm.bpel.def.StructuredActivity.leave(StructuredActivity.java:60) at org.jbpm.bpel.def.Activity$$FastClassByCGLIB$$a89e54a2.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136) at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.leave() at org.jbpm.bpel.def.StructuredActivity$End.execute(StructuredActivity.java:243)
at org.jbpm.bpel.def.Activity.enter(Activity.java:101) ... 414 more
17:47:53,740 WARN [JDBCExceptionReporter] SQL Error: 1205, SQLState: 4000117:47:53,740 ERROR [JDBCExceptionReporter] Your server command (family id #0, process id #541) encountered a deadlock situation. Please re-run your command.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 511, SQLState: ZZZZZ17:47:53,805 ERROR [JDBCExceptionReporter] Attempt to update or insert row failed because resultant row of size 4024 bytes is larger than the maximum size (1961 bytes) allowed for this table.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 3621, SQLState: 01ZZZ
17:47:53,805 ERROR [JDBCExceptionReporter] Command has been aborted.
17:47:53,805 ERROR [SchedulerSession] org.hibernate.exception.GenericJDBCException: could not insert: [org.jbpm.scheduler.exe.Timer]17:47:53,938 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)org.hibernate.AssertionFailure: null id in org.jbpm.graph.log.NodeLog entry (don't flush the Session after an exception occurs) at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48) at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:140) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:97) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:905)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:345) at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59) at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1473) at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1092) at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:306)
at org.jboss.tm.TxManager.commit(TxManager.java:224) at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:126) at org.hibernate.transaction.JTATransaction.commit(JTATransaction.java:146)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.leave()
at org.jbpm.bpel.def.StructuredActivity$End.execute(StructuredActivity.java:243)
at org.jbpm.bpel.def.Activity.enter(Activity.java:101)
... 414 more
17:47:53,740 WARN [JDBCExceptionReporter] SQL Error: 1205, SQLState: 40001
17:47:53,740 ERROR [JDBCExceptionReporter] Your server command (family id #0, process id #541) encountered a deadlock situation. Please re-run your command.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 511, SQLState: ZZZZZ
17:47:53,805 ERROR [JDBCExceptionReporter] Attempt to update or insert row failed because resultant row of size 4024 bytes is larger than the maximum size (1961 bytes) allowed for this table.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 3621, SQLState: 01ZZZ
17:47:53,805 ERROR [JDBCExceptionReporter] Command has been aborted.
17:47:53,805 ERROR [SchedulerSession] org.hibernate.exception.GenericJDBCException: could not insert: [org.jbpm.scheduler.exe.Timer]
17:47:53,938 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in org.jbpm.graph.log.NodeLog entry (don't flush the Session after an exception occurs)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:140)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:97) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:905)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:345) at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59) at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1473)
at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.leave()
at org.jbpm.bpel.def.StructuredActivity$End.execute(StructuredActivity.java:243)
at org.jbpm.bpel.def.Activity.enter(Activity.java:101)
... 414 more
17:47:53,740 WARN [JDBCExceptionReporter] SQL Error: 1205, SQLState: 40001
17:47:53,740 ERROR [JDBCExceptionReporter] Your server command (family id #0, process id #541) encountered a deadlock situation. Please re-run your command.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 511, SQLState: ZZZZZ
17:47:53,805 ERROR [JDBCExceptionReporter] Attempt to update or insert row failed because resultant row of size 4024 bytes is larger than the maximum size (1961 bytes) allowed for this table.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 3621, SQLState: 01ZZZ
17:47:53,805 ERROR [JDBCExceptionReporter] Command has been aborted.
17:47:53,805 ERROR [SchedulerSession] org.hibernate.exception.GenericJDBCException: could not insert: [org.jbpm.scheduler.exe.Timer]
17:47:53,938 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
68372,85-92 43%
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
at org.jbpm.bpel.def.CompositeActivity$$EnhancerByCGLIB$$4001fbf3.leave()
at org.jbpm.bpel.def.StructuredActivity$End.execute(StructuredActivity.java:243)
at org.jbpm.bpel.def.Activity.enter(Activity.java:101)
... 414 more
17:47:53,740 WARN [JDBCExceptionReporter] SQL Error: 1205, SQLState: 40001
17:47:53,740 ERROR [JDBCExceptionReporter] Your server command (family id #0, process id #541) encountered a deadlock situation. Please re-run your command.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 511, SQLState: ZZZZZ
17:47:53,805 ERROR [JDBCExceptionReporter] Attempt to update or insert row failed because resultant row of size 4024 bytes is larger than the maximum size (1961 bytes) allowed for this table.
17:47:53,805 WARN [JDBCExceptionReporter] SQL Error: 3621, SQLState: 01ZZZ
17:47:53,805 ERROR [JDBCExceptionReporter] Command has been aborted.
17:47:53,805 ERROR [SchedulerSession] org.hibernate.exception.GenericJDBCException: could not insert: [org.jbpm.scheduler.exe.Timer]
17:47:53,938 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in org.jbpm.graph.log.NodeLog entry (don't flush the Session after an exception occurs)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:140)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:97)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:905)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:345)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1473)
at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1092)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:306)
at org.jboss.tm.TxManager.commit(TxManager.java:224)
at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:126)
at org.hibernate.transaction.JTATransaction.commit(JTATransaction.java:146)
at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032811#4032811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032811
17Â years, 11Â months
[JBoss Seam] - Large Data Tables in Seam - feedback welcome
by ASavitsky
This is my take at the way to manage large datasets in @DataModel, without loading them all in memory. Hopefully, this code will be of use to others and/or generate useful improvement suggestions. Anyway, here goes:
LazyList.java - implements List interface, allowing its use in @DataModel. Only holds one page (size can be configured) worth of data, delegating the actual retrieval to the fetcher interface. Knows the total amount of data, again by calling the appropriate method in fetcher.
public class LazyList<T> implements List<T> {
| public static final int DEFAULT_PAGE_SIZE = 20;
| private int currentPage;
| private List<T> dataset;
| private int datasetSize;
| private IFetcher<T> fetcher;
| private int pageSize = DEFAULT_PAGE_SIZE;
|
| public LazyList(IFetcher<T> fetcher) {
| this.fetcher = fetcher;
| datasetSize = fetcher.getDatasetSize();
| currentPage = 0;
| }
| public LazyList(IFetcher<T> fetcher, int pageSize) {
| this(fetcher);
| this.pageSize = pageSize;
| }
| public T get(int index) {
| int requestedPage = index / pageSize;
| if (index < 0 || index > datasetSize) {
| throw new IndexOutOfBoundsException();
| }
| if (dataset == null || currentPage != requestedPage) {
| currentPage = requestedPage;
| dataset = fetcher.getDatasetPage(currentPage * pageSize, pageSize);
| }
| return dataset.get(index % pageSize);
| }
| public boolean isEmpty() {
| return datasetSize == 0;
| }
| public int size() {
| return datasetSize;
| }
| // the rest of the interface methods {
| throw new UnsupportedOperationException("Not implemented");
| }
| }
|
IFetcher.java:
public interface IFetcher<T> {
| /** Fetch a page of data */
| List<T> getDatasetPage(int start, int pageSize);
| /** Fetch total dataset size */
| int getDatasetSize();
| }
|
CriteriaFetcher.java - implemets fetcher interface via Hibernate criteria calls. Hibernate Session is injected via Seam, the criteria properties neeed to be specified during fetcher construction (cannot be placed in constructor as Seam needs a no-arg one). Criterias are used because sorting and filtering can easily be added to them.
@Name ("fetcher")
| @Scope (ScopeType.CONVERSATION)
| public class CriteriaFetcher<T> implements IFetcher<T>, Serializable {
| @Logger
| private static Log log;
| private DetachedCriteria countCriteria;
| private DetachedCriteria queryCriteria;
| @In
| private Session session;
|
| @SuppressWarnings ("unchecked")
| public List<T> getDatasetPage(int start, int pageSize) {
| log.trace("Fetching #0 records starting from #1", pageSize, start);
| return queryCriteria.getExecutableCriteria(session).setFirstResult(start).setMaxResults(pageSize).list();
| }
| @SuppressWarnings ("unchecked")
| public int getDatasetSize() {
| log.trace("Fetching dataset size");
| return (Integer) countCriteria.getExecutableCriteria(session).uniqueResult();
| }
| public void setCountCriteria(DetachedCriteria countCriteria) {
| this.countCriteria = countCriteria.setProjection(Projections.rowCount());
| }
| public void setQueryCriteria(DetachedCriteria queryCriteria) {
| this.queryCriteria = queryCriteria;
| }
| }
|
Now any bean would use the paged lists in the following way:
@In (create = true)
| private CriteriaFetcher<T> fetcher;
| @DataModel
| private LazyList<T> records;
|
| protected DetachedCriteria buildCriteria() {
| return DetachedCriteria.forClass(T.class);
| }
| @Factory ("records")
| public void createRecords() {
| fetcher.setCountCriteria(buildCriteria());
| fetcher.setQueryCriteria(buildCriteria());
| records = new LazyList<T>(fetcher, 10);
| }
|
If sorting/filtering is needed, simply recreate the records variable with a different fetcher that has the necessary sorts/filters built in. Until then, the constructed LazyList stays in its scope (CONVERSATION is recommended), fetching data pages as necessary.
Comments/suggestions are welcome - though the code is working already, so I'm not looking for others to fix it for me :)
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032810#4032810
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032810
17Â years, 11Â months