CommitAfter not working ( is back ! ) ( T5.1)

View: New views
4 Messages — Rating Filter:   Alert me  

CommitAfter not working ( is back ! ) ( T5.1)

by josete :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all !
I have this problem since long ago, using T5.1.0.5 with hibernate.

     @CommitAfter
     void onActionFromCancelRenew(Long subscriptionId) {
         Subscription subscription = (Subscription)
theSession.get(Subscription.class, subscriptionId);
         subscription.setRenewalStatus(RenewalStatus.CANCELED);
         theSession.update(subscription);
     }

And the problem is that the actual data is not stored in database :-(

To fix this situation, i had to use this methods :

     void onActionFromCancelRenew(Long subscriptionId) {
         theSession.beginTransaction();
         Subscription subscription = (Subscription)
theSession.get(Subscription.class, subscriptionId);
         subscription.setRenewalStatus(RenewalStatus.CANCELED);
         theSession.update(subscription);
         theSession.getTransaction().commit();
     }

but i get this errors :


2009-11-06 12:55:00,190  WARN  [class
org.apache.tapestry5.ioc.services.TapestryIOCModule.PerthreadManager]
org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:90)
Error invoking listener
org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl@1b5cf07:
Transaction not successfully started
org.hibernate.TransactionException: Transaction not successfully started
     at
org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:183)
     at
org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl.threadDidCleanup(HibernateSessionManagerImpl.java:65)
     at
org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:86)
     at
org.apache.tapestry5.ioc.internal.RegistryImpl.cleanupThread(RegistryImpl.java:344)
     at
org.apache.tapestry5.ioc.internal.RegistryWrapper.cleanupThread(RegistryWrapper.java:36)
     at
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:133)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
     at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
     at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
     at java.lang.Thread.run(Thread.java:619)


The situation is quite weird, as i have another T5.1.0.5 deployed in the
same tomcat server, 6.0.20, also with hibernate, and working perfectly
with @commitAfter tag.

Any solution to this, please ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: CommitAfter not working ( is back ! ) ( T5.1)

by josete :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Problem solved !!

I was missing the tapestry-hibernate.jar dependency !!
I had the tapestry-hibernate-core.jar, ... why both have to be included ?


> Hi all !
> I have this problem since long ago, using T5.1.0.5 with hibernate.
>
>     @CommitAfter
>     void onActionFromCancelRenew(Long subscriptionId) {
>         Subscription subscription = (Subscription)
> theSession.get(Subscription.class, subscriptionId);
>         subscription.setRenewalStatus(RenewalStatus.CANCELED);
>         theSession.update(subscription);
>     }
>
> And the problem is that the actual data is not stored in database :-(
>
> To fix this situation, i had to use this methods :
>
>     void onActionFromCancelRenew(Long subscriptionId) {
>         theSession.beginTransaction();
>         Subscription subscription = (Subscription)
> theSession.get(Subscription.class, subscriptionId);
>         subscription.setRenewalStatus(RenewalStatus.CANCELED);
>         theSession.update(subscription);
>         theSession.getTransaction().commit();
>     }
>
> but i get this errors :
>
>
> 2009-11-06 12:55:00,190  WARN  [class
> org.apache.tapestry5.ioc.services.TapestryIOCModule.PerthreadManager]
> org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:90)
> Error invoking listener
> org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl@1b5cf07:
> Transaction not successfully started
> org.hibernate.TransactionException: Transaction not successfully started
>     at
> org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:183)
>
>     at
> org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl.threadDidCleanup(HibernateSessionManagerImpl.java:65)
>
>     at
> org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:86)
>
>     at
> org.apache.tapestry5.ioc.internal.RegistryImpl.cleanupThread(RegistryImpl.java:344)
>
>     at
> org.apache.tapestry5.ioc.internal.RegistryWrapper.cleanupThread(RegistryWrapper.java:36)
>
>     at
> org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:133)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>
>     at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>
>     at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
>     at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
>     at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>
>     at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>
>     at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>
>     at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>     at java.lang.Thread.run(Thread.java:619)
>
>
> The situation is quite weird, as i have another T5.1.0.5 deployed in
> the same tomcat server, 6.0.20, also with hibernate, and working
> perfectly with @commitAfter tag.
>
> Any solution to this, please ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: CommitAfter not working ( is back ! ) ( T5.1)

by Howard Lewis Ship :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

tapesty-hibernate-core includes the annotation and the support for
using it with services. It is designed for use outside of a T5 web
application, with dependencies on tapestry-ioc (not tapestry-core).

tapestry-hibernate builds on that, adding support for using
@CommitAfter with component methods.

On Fri, Nov 6, 2009 at 7:34 AM, josete <joseluis.sanchez@...> wrote:

> Problem solved !!
>
> I was missing the tapestry-hibernate.jar dependency !!
> I had the tapestry-hibernate-core.jar, ... why both have to be included ?
>
>
>> Hi all !
>> I have this problem since long ago, using T5.1.0.5 with hibernate.
>>
>>    @CommitAfter
>>    void onActionFromCancelRenew(Long subscriptionId) {
>>        Subscription subscription = (Subscription)
>> theSession.get(Subscription.class, subscriptionId);
>>        subscription.setRenewalStatus(RenewalStatus.CANCELED);
>>        theSession.update(subscription);
>>    }
>>
>> And the problem is that the actual data is not stored in database :-(
>>
>> To fix this situation, i had to use this methods :
>>
>>    void onActionFromCancelRenew(Long subscriptionId) {
>>        theSession.beginTransaction();
>>        Subscription subscription = (Subscription)
>> theSession.get(Subscription.class, subscriptionId);
>>        subscription.setRenewalStatus(RenewalStatus.CANCELED);
>>        theSession.update(subscription);
>>        theSession.getTransaction().commit();
>>    }
>>
>> but i get this errors :
>>
>>
>> 2009-11-06 12:55:00,190  WARN  [class
>> org.apache.tapestry5.ioc.services.TapestryIOCModule.PerthreadManager]
>> org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:90)
>> Error invoking listener
>> org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl@1b5cf07:
>> Transaction not successfully started
>> org.hibernate.TransactionException: Transaction not successfully started
>>    at
>> org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:183)
>>    at
>> org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl.threadDidCleanup(HibernateSessionManagerImpl.java:65)
>>    at
>> org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:86)
>>    at
>> org.apache.tapestry5.ioc.internal.RegistryImpl.cleanupThread(RegistryImpl.java:344)
>>    at
>> org.apache.tapestry5.ioc.internal.RegistryWrapper.cleanupThread(RegistryWrapper.java:36)
>>    at
>> org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:133)
>>    at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>    at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>    at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>    at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>    at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>    at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>    at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>    at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>>    at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>>    at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>    at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>>    at java.lang.Thread.run(Thread.java:619)
>>
>>
>> The situation is quite weird, as i have another T5.1.0.5 deployed in the
>> same tomcat server, 6.0.20, also with hibernate, and working perfectly with
>> @commitAfter tag.
>>
>> Any solution to this, please ?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>



--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: CommitAfter not working ( is back ! ) ( T5.1)

by Sebastian Hennebrueder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

By the way the update statement is not required. Your object is already
in persistent state. Just change it.

josete schrieb:

> Problem solved !!
>
> I was missing the tapestry-hibernate.jar dependency !!
> I had the tapestry-hibernate-core.jar, ... why both have to be included ?
>
>
>> Hi all !
>> I have this problem since long ago, using T5.1.0.5 with hibernate.
>>
>>     @CommitAfter
>>     void onActionFromCancelRenew(Long subscriptionId) {
>>         Subscription subscription = (Subscription)
>> theSession.get(Subscription.class, subscriptionId);
>>         subscription.setRenewalStatus(RenewalStatus.CANCELED);
>>         theSession.update(subscription);
>>     }
>>
>> And the problem is that the actual data is not stored in database :-(
>>
>> To fix this situation, i had to use this methods :
>>
>>     void onActionFromCancelRenew(Long subscriptionId) {
>>         theSession.beginTransaction();
>>         Subscription subscription = (Subscription)
>> theSession.get(Subscription.class, subscriptionId);
>>         subscription.setRenewalStatus(RenewalStatus.CANCELED);
>>         theSession.update(subscription);
>>         theSession.getTransaction().commit();
>>     }
>>
>> but i get this errors :
>>
>>
>> 2009-11-06 12:55:00,190  WARN  [class
>> org.apache.tapestry5.ioc.services.TapestryIOCModule.PerthreadManager]
>> org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:90)
>> Error invoking listener
>> org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl@1b5cf07:
>> Transaction not successfully started
>> org.hibernate.TransactionException: Transaction not successfully started
>>     at
>> org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:183)
>>
>>     at
>> org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl.threadDidCleanup(HibernateSessionManagerImpl.java:65)
>>
>>     at
>> org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:86)
>>
>>     at
>> org.apache.tapestry5.ioc.internal.RegistryImpl.cleanupThread(RegistryImpl.java:344)
>>
>>     at
>> org.apache.tapestry5.ioc.internal.RegistryWrapper.cleanupThread(RegistryWrapper.java:36)
>>
>>     at
>> org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:133)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>
>>     at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>
>>     at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>
>>     at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>
>>     at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>
>>     at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>
>>     at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>>
>>     at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>>
>>     at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>
>>     at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>>     at java.lang.Thread.run(Thread.java:619)
>>
>>
>> The situation is quite weird, as i have another T5.1.0.5 deployed in
>> the same tomcat server, 6.0.20, also with hibernate, and working
>> perfectly with @commitAfter tag.
>>
>> Any solution to this, please ?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>



--
Best Regards / Viele Grüße

Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...