Long hibernate transactions

This is just a short reminder to the cause and solution of the following exception (hibernate + jboss 4.2.2 GA + oracle 10): 2012-02-09 13:09:50,333 ERROR [Thread-3-org.hibernate.AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) java.lang.NullPointerException at org.hibernate.engine.ActionQueue.afterTransactionCompletion(ActionQueue.java:176) at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:424) at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:225) at org.hibernate.transaction.CacheSynchronization.afterCompletion(CacheSynchronization.java:85) at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:136) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:340) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:107) at com.arjuna.ats.arjuna.AtomicAction.cancel(AtomicAction.java:230) at com.arjuna.ats.arjuna.coordinator.TransactionReaper.check(TransactionReaper.java:202) at com.arjuna.ats.internal.arjuna.coordinator.ReaperThread.run(ReaperThread.java:107) 2012-02-09 13:09:50,339 WARN [Thread-3-com....

February 9, 2012 · len

A bit more about hibernate cache, when the cache hurts

I have learned a lot about hibernate cache at the time I wrote the previous article on this subject and this brings also an interesting detail. You are using the query and second level cache. Here is an interesting sequence: 1. You execute a query which returns items of entity A. First time it takes some time. 2. You execute the query again, it takes much less time, you are very happy :)...

February 9, 2012 · len

Call Oracle procedure from hibernate

After debuging for a few hours I’ve found the proper way of calling an Oracle function from hibernate and to use the return parameters. Here is the solution. The Oracle SQL function which returns -1 or 0: <pre lang="sql">create or replace function checkLastNPass (userId IN number, ... other params) RETURN SYS_REFCURSOR is st_cursor SYS_REFCURSOR; prevId number:= userId; ... other scope variables begin ... OPEN st_cursor FOR select -1 as retVal from DUAL; return st_cursor; ....

October 17, 2011 · len

JBPM Hibernate cache

Applies to: JBPM 3.1.2, JBoss 4.0.5-GA Everything starts with a beautiful concept but has to pass past those nasty errors. The same applies to this JBPM project, everything was nice, I have seen it running and then I was supposed to take the sources, clean, organize and enhance. Everything ok until now. The only problem is that when deploying the JBPM (sar) service there was this error: 16:09:17,402 ERROR [CommandExecutorThread] org....

January 4, 2007 · len