BTM Warnings

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

BTM Warnings

Douglas Ferguson-3
Hi,

I just configured BTM using Spring and Hibernate.

I'm see the following warnings in my logs, that I was not seeing when using plain JPATransactionManager.

Does anybody have any advice on these?


1) This seems to occur right after an sql statement prints out, definitely after reads
Hibernate: update site_user set failed_login_attempts=0 where lockout_time<?
STDOUT [WARN ] [2012.02.20 15:15:00] twopc.Preparer - executing transaction with 0 enlisted resource

2) This occurs when I edit a user in my app. 
STDOUT [WARN ] [2012.02.20 15:14:06] tm.BitronixTransaction - Synchronization.afterCompletion() call failed for org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@405d65c3
java.util.ConcurrentModificationException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384)
at org.hibernate.engine.transaction.internal.SynchronizationRegistryImpl.notifySynchronizationsAfterTransactionCompletion(SynchronizationRegistryImpl.java:78)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.sendAfterTransactionCompletionNotifications(TransactionCoordinatorImpl.java:333)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.afterTransaction(TransactionCoordinatorImpl.java:145)
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.afterCompletion(SynchronizationCallbackCoordinatorImpl.java:126)
at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.afterCompletion(RegisteredSynchronization.java:61)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:244)
at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.xxxx.ui.administration.users.SiteUserResourceProvider$$EnhancerByCGLIB$$dc04900d.save(<generated>)
at com.xxxx.ui.viewer.AdaptableForm.save(AdaptableForm.java:407)
at com.xxxx.ui.viewer.AdaptableForm.attemptSave(AdaptableForm.java:274)
at com.xxxx.ui.viewer.AdaptableForm$5.buttonClick(AdaptableForm.java:323)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:550)
at com.vaadin.ui.Button.changeVariables(Button.java:217)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1451)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1399)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1318)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:763)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at com.xxxxx.servlet.ApplicationServlet.service(ApplicationServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:550)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1359)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at com.xxxxx.security.filter.IpAddressAuditFilter.doFilterInternal(IpAddressAuditFilter.java:54)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at com.xxxxxx.security.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1330)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:970)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:414)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:187)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:904)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:347)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:590)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1071)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
at java.lang.Thread.run(Thread.java:680)

Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Ludovic Orban-2
The "executing transaction with 0 enlisted resource" message can have two meanings: either you executed an empty transaction in which you do not read not write any data, or you misconfigured Hibernate and it's not using BTM's connection pool.

In the former case, you can disable this warning by disabling the warnAboutZeroResourceTransactions configuration property, see http://docs.codehaus.org/display/BTM/Configuration2x#Configuration2x-Transactionenginesettings

In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.



2012/2/20 Douglas Ferguson <[hidden email]>
Hi,

I just configured BTM using Spring and Hibernate.

I'm see the following warnings in my logs, that I was not seeing when using plain JPATransactionManager.

Does anybody have any advice on these?


1) This seems to occur right after an sql statement prints out, definitely after reads
Hibernate: update site_user set failed_login_attempts=0 where lockout_time<?
STDOUT [WARN ] [2012.02.20 15:15:00] twopc.Preparer - executing transaction with 0 enlisted resource

2) This occurs when I edit a user in my app. 
STDOUT [WARN ] [2012.02.20 15:14:06] tm.BitronixTransaction - Synchronization.afterCompletion() call failed for org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@405d65c3
java.util.ConcurrentModificationException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384)
at org.hibernate.engine.transaction.internal.SynchronizationRegistryImpl.notifySynchronizationsAfterTransactionCompletion(SynchronizationRegistryImpl.java:78)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.sendAfterTransactionCompletionNotifications(TransactionCoordinatorImpl.java:333)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.afterTransaction(TransactionCoordinatorImpl.java:145)
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.afterCompletion(SynchronizationCallbackCoordinatorImpl.java:126)
at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.afterCompletion(RegisteredSynchronization.java:61)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:244)
at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.xxxx.ui.administration.users.SiteUserResourceProvider$$EnhancerByCGLIB$$dc04900d.save(<generated>)
at com.xxxx.ui.viewer.AdaptableForm.save(AdaptableForm.java:407)
at com.xxxx.ui.viewer.AdaptableForm.attemptSave(AdaptableForm.java:274)
at com.xxxx.ui.viewer.AdaptableForm$5.buttonClick(AdaptableForm.java:323)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:550)
at com.vaadin.ui.Button.changeVariables(Button.java:217)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1451)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1399)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1318)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:763)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at com.xxxxx.servlet.ApplicationServlet.service(ApplicationServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:550)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1359)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at com.xxxxx.security.filter.IpAddressAuditFilter.doFilterInternal(IpAddressAuditFilter.java:54)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at com.xxxxxx.security.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1330)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:970)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:414)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:187)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:904)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:347)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:590)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1071)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
at java.lang.Thread.run(Thread.java:680)


Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Douglas Ferguson-3

On Feb 21, 2012, at 10:35 AM, Ludovic Orban wrote:

The "executing transaction with 0 enlisted resource" message can have two meanings: either you executed an empty transaction in which you do not read not write any data, or you misconfigured Hibernate and it's not using BTM's connection pool.

In the former case, you can disable this warning by disabling the warnAboutZeroResourceTransactions configuration property, see http://docs.codehaus.org/display/BTM/Configuration2x#Configuration2x-Transactionenginesettings

Actually we have found several places where classes are marked @Transactional and there are methods that aren't involved in transactions.
We are gonna to try to clean them up.

Does this makes sense?


In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.

I'm not sure I follow you. We configure our entity manager via spring and is wired through to the entity manager via the  bitronix.tm.resource.jdbc.PoolingDataSource
So there is really no way for any of the code to get at the db directly.




2012/2/20 Douglas Ferguson <[hidden email]>
Hi,

I just configured BTM using Spring and Hibernate.

I'm see the following warnings in my logs, that I was not seeing when using plain JPATransactionManager.

Does anybody have any advice on these?


1) This seems to occur right after an sql statement prints out, definitely after reads
Hibernate: update site_user set failed_login_attempts=0 where lockout_time<?
STDOUT [WARN ] [2012.02.20 15:15:00] twopc.Preparer - executing transaction with 0 enlisted resource

2) This occurs when I edit a user in my app. 
STDOUT [WARN ] [2012.02.20 15:14:06] tm.BitronixTransaction - Synchronization.afterCompletion() call failed for org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@405d65c3
java.util.ConcurrentModificationException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384)
at org.hibernate.engine.transaction.internal.SynchronizationRegistryImpl.notifySynchronizationsAfterTransactionCompletion(SynchronizationRegistryImpl.java:78)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.sendAfterTransactionCompletionNotifications(TransactionCoordinatorImpl.java:333)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.afterTransaction(TransactionCoordinatorImpl.java:145)
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.afterCompletion(SynchronizationCallbackCoordinatorImpl.java:126)
at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.afterCompletion(RegisteredSynchronization.java:61)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:244)
at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.xxxx.ui.administration.users.SiteUserResourceProvider$$EnhancerByCGLIB$$dc04900d.save(<generated>)
at com.xxxx.ui.viewer.AdaptableForm.save(AdaptableForm.java:407)
at com.xxxx.ui.viewer.AdaptableForm.attemptSave(AdaptableForm.java:274)
at com.xxxx.ui.viewer.AdaptableForm$5.buttonClick(AdaptableForm.java:323)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:550)
at com.vaadin.ui.Button.changeVariables(Button.java:217)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1451)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1399)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1318)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:763)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at com.xxxxx.servlet.ApplicationServlet.service(ApplicationServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:550)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1359)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at com.xxxxx.security.filter.IpAddressAuditFilter.doFilterInternal(IpAddressAuditFilter.java:54)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at com.xxxxxx.security.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1330)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:970)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:414)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:187)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:904)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:347)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:590)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1071)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
at java.lang.Thread.run(Thread.java:680)



Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Ludovic Orban-2

Actually we have found several places where classes are marked @Transactional and there are methods that aren't involved in transactions.
We are gonna to try to clean them up.

Does this makes sense?


That's fair. Or you can just disable warnAboutZeroResourceTransaction if you don't want to be bothered by those warnings as they're harmless.

In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.

I'm not sure I follow you. We configure our entity manager via spring and is wired through to the entity manager via the  bitronix.tm.resource.jdbc.PoolingDataSource
So there is really no way for any of the code to get at the db directly.


In that case, you shouldn't worry at all. It's just that I've seen too many times users trying to use BTM with another connection pool like C3P0 and expecting everything to work. That's exactly the reason why this warning was built-in: to make sure that your setup is sane, which seems to be your case.
 
Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Douglas Ferguson-3
So the concurrent modification is not a problem and we can safely silence it in our logs?

On Feb 21, 2012, at 11:05 AM, Ludovic Orban wrote:


Actually we have found several places where classes are marked @Transactional and there are methods that aren't involved in transactions.
We are gonna to try to clean them up.

Does this makes sense?


That's fair. Or you can just disable warnAboutZeroResourceTransaction if you don't want to be bothered by those warnings as they're harmless.

In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.

I'm not sure I follow you. We configure our entity manager via spring and is wired through to the entity manager via the  bitronix.tm.resource.jdbc.PoolingDataSource
So there is really no way for any of the code to get at the db directly.


In that case, you shouldn't worry at all. It's just that I've seen too many times users trying to use BTM with another connection pool like C3P0 and expecting everything to work. That's exactly the reason why this warning was built-in: to make sure that your setup is sane, which seems to be your case.
 

Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Ludovic Orban-2
That looks like a problem in Hibernate itself. I cannot tell you much more about it, except that you probably should report it to the Hibernate guys.

2012/2/21 Douglas Ferguson <[hidden email]>
So the concurrent modification is not a problem and we can safely silence it in our logs?

On Feb 21, 2012, at 11:05 AM, Ludovic Orban wrote:


Actually we have found several places where classes are marked @Transactional and there are methods that aren't involved in transactions.
We are gonna to try to clean them up.

Does this makes sense?


That's fair. Or you can just disable warnAboutZeroResourceTransaction if you don't want to be bothered by those warnings as they're harmless.

In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.

I'm not sure I follow you. We configure our entity manager via spring and is wired through to the entity manager via the  bitronix.tm.resource.jdbc.PoolingDataSource
So there is really no way for any of the code to get at the db directly.


In that case, you shouldn't worry at all. It's just that I've seen too many times users trying to use BTM with another connection pool like C3P0 and expecting everything to work. That's exactly the reason why this warning was built-in: to make sure that your setup is sane, which seems to be your case.
 


Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Douglas Ferguson-3
Ok.. But FYI.. It only happens when I enable btm. 

When using the JPATransactionManager it works fine with no errors.

Douglas


On Feb 21, 2012, at 11:17 AM, Ludovic Orban wrote:

That looks like a problem in Hibernate itself. I cannot tell you much more about it, except that you probably should report it to the Hibernate guys.

2012/2/21 Douglas Ferguson <[hidden email]>
So the concurrent modification is not a problem and we can safely silence it in our logs?

On Feb 21, 2012, at 11:05 AM, Ludovic Orban wrote:


Actually we have found several places where classes are marked @Transactional and there are methods that aren't involved in transactions.
We are gonna to try to clean them up.

Does this makes sense?


That's fair. Or you can just disable warnAboutZeroResourceTransaction if you don't want to be bothered by those warnings as they're harmless.

In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.

I'm not sure I follow you. We configure our entity manager via spring and is wired through to the entity manager via the  bitronix.tm.resource.jdbc.PoolingDataSource
So there is really no way for any of the code to get at the db directly.


In that case, you shouldn't worry at all. It's just that I've seen too many times users trying to use BTM with another connection pool like C3P0 and expecting everything to work. That's exactly the reason why this warning was built-in: to make sure that your setup is sane, which seems to be your case.
 



Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Ludovic Orban-2
Makes sense since it happens in Hibernate's JTA code.

2012/2/21 Douglas Ferguson <[hidden email]>
Ok.. But FYI.. It only happens when I enable btm. 

When using the JPATransactionManager it works fine with no errors.

Douglas


On Feb 21, 2012, at 11:17 AM, Ludovic Orban wrote:

That looks like a problem in Hibernate itself. I cannot tell you much more about it, except that you probably should report it to the Hibernate guys.

2012/2/21 Douglas Ferguson <[hidden email]>
So the concurrent modification is not a problem and we can safely silence it in our logs?

On Feb 21, 2012, at 11:05 AM, Ludovic Orban wrote:


Actually we have found several places where classes are marked @Transactional and there are methods that aren't involved in transactions.
We are gonna to try to clean them up.

Does this makes sense?


That's fair. Or you can just disable warnAboutZeroResourceTransaction if you don't want to be bothered by those warnings as they're harmless.

In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.

I'm not sure I follow you. We configure our entity manager via spring and is wired through to the entity manager via the  bitronix.tm.resource.jdbc.PoolingDataSource
So there is really no way for any of the code to get at the db directly.


In that case, you shouldn't worry at all. It's just that I've seen too many times users trying to use BTM with another connection pool like C3P0 and expecting everything to work. That's exactly the reason why this warning was built-in: to make sure that your setup is sane, which seems to be your case.
 




Reply | Threaded
Open this post in threaded view
|

Re: BTM Warnings

Douglas Ferguson-3
Ok.. Cool.


On Feb 21, 2012, at 11:32 AM, Ludovic Orban wrote:

Makes sense since it happens in Hibernate's JTA code.

2012/2/21 Douglas Ferguson <[hidden email]>
Ok.. But FYI.. It only happens when I enable btm. 

When using the JPATransactionManager it works fine with no errors.

Douglas


On Feb 21, 2012, at 11:17 AM, Ludovic Orban wrote:

That looks like a problem in Hibernate itself. I cannot tell you much more about it, except that you probably should report it to the Hibernate guys.

2012/2/21 Douglas Ferguson <[hidden email]>
So the concurrent modification is not a problem and we can safely silence it in our logs?

On Feb 21, 2012, at 11:05 AM, Ludovic Orban wrote:


Actually we have found several places where classes are marked @Transactional and there are methods that aren't involved in transactions.
We are gonna to try to clean them up.

Does this makes sense?


That's fair. Or you can just disable warnAboutZeroResourceTransaction if you don't want to be bothered by those warnings as they're harmless.

In the latter case, you have to make sure Hibernate only uses BTM's connection pool as without it, BTM cannot track what's happening on your DB behind the scene and won't be able to commit or rollback atomically.

I'm not sure I follow you. We configure our entity manager via spring and is wired through to the entity manager via the  bitronix.tm.resource.jdbc.PoolingDataSource
So there is really no way for any of the code to get at the db directly.


In that case, you shouldn't worry at all. It's just that I've seen too many times users trying to use BTM with another connection pool like C3P0 and expecting everything to work. That's exactly the reason why this warning was built-in: to make sure that your setup is sane, which seems to be your case.