Announcement Announcement Module
Collapse
No announcement yet.
JtaTransactionManager with Kodo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JtaTransactionManager with Kodo

    I'm trying to use the JtaTransactionManager with two Datasources. My JDO implementation is Kodo 4.1.4 and I use JOTM in Tomcat 5.5.

    After some failing tries to make it work I debugged through the openJPA source Kodo is based on and observed the BrokerImpl class not to be aware of a transaction synchronization. Some tries to manually call Spring's TransactionSynchronizationManager.initSynchronizat ion() before the Kodo PersistenceManager was initialized were successful. I also managed to create a working JUnit test only by using TransactionSynchronizationManager.initSynchronizat ion().

    This doesn't work when changing attributes of Kodo managed beans. It seems to me that Kodo doesn't really care about transaction synchronization but when changes have to be commited, I get the stacktrace below.

    Does anyone have an idea or some hints on how to make Kodo work in Spring together with the JtaTransactionManager? I configured Kodo to use the JOTM UserTransaction but it doesn't help. Somtimes Kodo seems to sync with an existing transaction, sometimes it completely ignores everything. Did I miss some configuration parameter?

    Stack:
    Code:
    Exception thrown in method 'setSchreibender' of class [persistence.entities.DokumentMetaInformation]: '<1.0.0-SNAPSHOT-SNAPSHOT nonfatal user error> kodo.jdo.UserException: To perform writes on persistent data outside of a transaction, the "NontransactionalWrite" property must be set to true.
    FailedObject: persistence.entities.DokumentMetaInformation-117' (DokumentMetaInformation.java:232) (DokumentMetaInformation.log:145)
    <1.0.0-SNAPSHOT-SNAPSHOT nonfatal user error> kodo.jdo.UserException: To perform writes on persistent data outside of a transaction, the "NontransactionalWrite" property must be set to true.
    FailedObject: persistence.entities.DokumentMetaInformation-117
            at org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1452)
            at org.apache.openjpa.kernel.StateManagerImpl.settingObjectField(StateManagerImpl.java:1772)
            at persistence.entities.DokumentMetaInformation.pcSetschreibender(DokumentMetaInformation.java)
            at persistence.entities.DokumentMetaInformation.setSchreibender(DokumentMetaInformation.java:232)
            at service.dokumente.impl.DokumentServiceImpl.openDocument(DokumentServiceImpl.java:158)
            at service.dokumente.impl.DatenverwaltungServiceImpl.openDocument(DatenverwaltungServiceImpl.java:372)
            at service.dokumente.impl.DatenverwaltungServiceImpl.openDocument(DatenverwaltungServiceImpl.java:346)
            at service.verteiler.dv.impl.VerteilerVerwaltungImpl.open(VerteilerVerwaltungImpl.java:140)
            at webapp.verteiler.dv.VerteilerDvAction.open_aroundBody0(VerteilerDvAction.java:130)
            at webapp.verteiler.dv.VerteilerDvAction$AjcClosure1.run(VerteilerDvAction.java:1)
            at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:101)
            at webapp.verteiler.session.VerteilerMappeSessionAspect.invoke(VerteilerMappeSessionAspect.java:226)
            at webapp.verteiler.dv.VerteilerDvAction.open(VerteilerDvAction.java:116)
            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 org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
            at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
            at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:130)
            at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
            at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
            at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.securechannel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:138)
            at webapp.securechannel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:29)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at web.AbstractIncludeExcludeFilter.doFilter(AbstractIncludeExcludeFilter.java:35)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at webapp.session.SessionHijackFilter.doFilterInternal(SessionHijackFilter.java:34)
            at web.AbstractIncludeExcludeFilter.doFilter(AbstractIncludeExcludeFilter.java:33)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:191)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at webapp.browsercheck.BrowserCheckFilter.doFilterInternal(BrowserCheckFilter.java:45)
            at web.AbstractIncludeExcludeFilter.doFilter(AbstractIncludeExcludeFilter.java:33)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
            at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at i18n.webapp.LocaleResolverFilter.doFilter(LocaleResolverFilter.java:50)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter.doFilterInternal(OpenPersistenceManagerInViewFilter.java:104)
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
Working...
X