You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Robert A. T. Káldy" <ro...@antonio.cz> on 2013/05/07 11:21:54 UTC

Hibernate Commit Advice doesn't work with InnoDB tables

Hello,
I put a commit advice to all my DAO classes:

@Match("*DAO*")
public static void adviseTransactions(HibernateTransactionAdvisor 
advisor, MethodAdviceReceiver receiver) {
     advisor.addTransactionCommitAdvice(receiver);
}

It works well for MyISAM tables, but no persist call is committed after 
I switched to InnoDB. The @CommitAfter doesn't work too. The only way is 
to explicitly call session.getTransaction().commit() .
I've set MySQL5InnoDBDialect and hibernate.connection.autocommit in 
hibernate.cfg.xml, but neither of them helped me.
TIA
Robert-Antonio

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


Re: Hibernate Commit Advice doesn't work with InnoDB tables

Posted by "Robert A. T. Káldy" <ro...@antonio.cz>.
On 05/07/2013 11:55 AM, Dmitry Gusev wrote:
> Make sure you've annotated your interfaces but not the implementations with
> @CommitAfter.
>
> Also try to remove last asterisk from @Match("*DAO*") to make it look like
> @Match("*DAO")
>

Thanks, that solved it.
Robert-Antonio

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


Re: Hibernate Commit Advice doesn't work with InnoDB tables

Posted by Dmitry Gusev <dm...@gmail.com>.
Hi,

MyISAM doesn't support transactions so there's nothing to commit or
rollback.

Make sure you've annotated your interfaces but not the implementations with
@CommitAfter.

Also try to remove last asterisk from @Match("*DAO*") to make it look like
@Match("*DAO")


On Tue, May 7, 2013 at 1:21 PM, "Robert A. T. Káldy" <ro...@antonio.cz>wrote:

> Hello,
> I put a commit advice to all my DAO classes:
>
> @Match("*DAO*")
> public static void adviseTransactions(**HibernateTransactionAdvisor
> advisor, MethodAdviceReceiver receiver) {
>     advisor.**addTransactionCommitAdvice(**receiver);
> }
>
> It works well for MyISAM tables, but no persist call is committed after I
> switched to InnoDB. The @CommitAfter doesn't work too. The only way is to
> explicitly call session.getTransaction().**commit() .
> I've set MySQL5InnoDBDialect and hibernate.connection.**autocommit in
> hibernate.cfg.xml, but neither of them helped me.
> TIA
> Robert-Antonio
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com