Hi,
We are using Hibernate 3.0 with JBoss 4.0.3 app server.
We came across a weird problem with hibernate- it automatically rollbacks transaction with no obvious reason .The problem is intermittent- probably occurs when the server is started, few transactions are performed and then kept idle (no transactions) for few days and then again perform some transaction.
Here is the log trace:
2006-12-20 15:46:54,021 DEBUG Loading PolicyBackup...
2006-12-20 15:46:54,022 DEBUG [org.hibernate.transaction.CacheSynchronization] transaction after completion callback, status: 4
2006-12-20 15:46:54,022 DEBUG [org.hibernate.jdbc.JDBCContext] after transaction completion
2006-12-20 15:46:54,022 DEBUG [org.hibernate.impl.SessionImpl] after transaction completion
2006-12-20 15:46:54,022 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [public.customer], timestamp: 4778433798234112 2006-12-20 15:46:54,022 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [public.customer], timestamp: 4778433798234113 2006-12-20 15:46:54,022 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [public.groups], timestamp: 4778433798234114 2006-12-20 15:46:54,022 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [public.customer], timestamp: 4778433798234115 2006-12-20 15:46:54,022 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [public.groups], timestamp: 4778433798234116 2006-12-20 15:46:54,022 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [public.users], timestamp: 47784337982341172006-12-20 15:46:54,022 DEBUG [org.hibernate.transaction.CacheSynchronization] automatically closing session
2006-12-20 15:46:54,023 DEBUG [org.hibernate.impl.SessionImpl] automatically closing session
2006-12-20 15:46:54,023 DEBUG [org.hibernate.impl.SessionImpl] closing session
2006-12-20 15:46:54,023 DEBUG [org.hibernate.jdbc.ConnectionManager] connection already null in cleanup : no action
To explain the log trace:
We have a Policy object which has a one-one relationship with PolicyBackup object.
i.e
Policy
{
String name;
String description;
PolicyBackup policyBackup;
.........
}
Here we are trying to load a Policy.The properties of the policy get loaded properly,but when we try to load the association policyBackup we get this error trace.I can see from the trace that transaction is rolled back(status-4)...don't why? And I also see the lines 'Invalidating space' in the trace.
When i restart server, everything works fine.Is it something related to hibernate caching - specifically second level cache?
Any ideas on why this could happen?
Thanks in advance,
Ram
|