You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2014/11/21 06:56:10 UTC
tapestry-hibernate session.save not working in service
Hi guys, I'm trying to use Kalle's federate library. On line 29 and 33
you'll see save and update and when I do a save / update nothing happens. I
turned on query logging and no insert happens.
https://github.com/tynamo/tynamo-federatedaccounts/blob/master/tynamo-federatedaccounts-core/src/main/java/org/tynamo/security/federatedaccounts/services/DefaultHibernateFederatedAccountServiceImpl.java
Any idea what might be going on here?
Re: tapestry-hibernate session.save not working in service
Posted by George Christman <gc...@cardaddy.com>.
On Fri, Nov 21, 2014 at 9:54 AM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> On Fri, 21 Nov 2014 12:50:11 -0200, George Christman <
> gchristman@cardaddy.com> wrote:
>
> I tried those Lance with the exception of @CommitAfter do to the fact I
>> thought that @CommitAfter needed to be used in the interface.
>>
>
> Before the latest 5.4 betas yes, but not anymore.
>
> I even went as far as passing the save off to my DAO
>>
>
> What would be the point of having a DAO if your business rules classes
> used Hibernate directly? :)
I have a generic dao I use for my entire application that is
configured with HibernateTransactionAdvisor. I wasn't aware of the fact you
can now use @CommitAfter in the impl in 5.4, so I figured passing the save
off to my DAO would overcome the HibernateTransactionAdvisor issue.
>
>
> that has been configured to use HibernateTransactionAdvisor.
>>
>
> Have you tried to your business rules service too? No, how can you
> use @Match("*DAO") on multiples? Maybe one on "*Impl" ?
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York
Re: tapestry-hibernate session.save not working in service
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 21 Nov 2014 12:50:11 -0200, George Christman
<gc...@cardaddy.com> wrote:
> I tried those Lance with the exception of @CommitAfter do to the fact I
> thought that @CommitAfter needed to be used in the interface.
Before the latest 5.4 betas yes, but not anymore.
> I even went as far as passing the save off to my DAO
What would be the point of having a DAO if your business rules classes
used Hibernate directly? :)
> that has been configured to use HibernateTransactionAdvisor.
Have you tried to your business rules service too?
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: tapestry-hibernate session.save not working in service
Posted by George Christman <gc...@cardaddy.com>.
I tried those Lance with the exception of @CommitAfter do to the fact I
thought that @CommitAfter needed to be used in the interface. I even went
as far as passing the save off to my DAO that has been configured to use
HibernateTransactionAdvisor. I thought for sure this would resolve the
issue, but still nothing. The query in the class is functioning perfectly
though.
On Fri, Nov 21, 2014 at 7:31 AM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> @CommitAfter will only work on service methods if you applied the
> HibernateTransactionAdvisor or HibernateTransactionDecorator to the service.
>
>
> On Fri, 21 Nov 2014 06:47:43 -0200, Lance Java <la...@googlemail.com>
> wrote:
>
> I'm guessing you need to commit a transaction.
>>
>> Either:
>> HibernateSessionManager.commit()
>>
>> Or:
>> Session.getTransaction().commit()
>>
>> Or:
>> @CommitAfter
>>
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York
Re: tapestry-hibernate session.save not working in service
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
@CommitAfter will only work on service methods if you applied the
HibernateTransactionAdvisor or HibernateTransactionDecorator to the
service.
On Fri, 21 Nov 2014 06:47:43 -0200, Lance Java <la...@googlemail.com>
wrote:
> I'm guessing you need to commit a transaction.
>
> Either:
> HibernateSessionManager.commit()
>
> Or:
> Session.getTransaction().commit()
>
> Or:
> @CommitAfter
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: tapestry-hibernate session.save not working in service
Posted by Lance Java <la...@googlemail.com>.
I'm guessing you need to commit a transaction.
Either:
HibernateSessionManager.commit()
Or:
Session.getTransaction().commit()
Or:
@CommitAfter