JpaEventStore and resource local transactions

585 views
Skip to first unread message

Andrea Mariottini

unread,
Jul 31, 2013, 11:48:51 AM7/31/13
to axonfr...@googlegroups.com
I have a persistence unit with resource local transactions.
It seems Axonframework doesn't handle the transaction explicitly in this context and this exception is thrown:

[2013-07-31 17:43:05,896 - DEBUG] (NestableUnitOfWork.java:58) -> [An error occurred while committing this UnitOfWork. Performing rollback...]
........
[2013-07-31 17:43:05,899 - DEBUG] (CommandGenerator.java:42) -> [javax.persistence.TransactionRequiredException: no transaction is in progress

How can I solve?
Of course change to jta transactions is not an option for me.

Allard Buijze

unread,
Aug 1, 2013, 9:30:09 AM8/1/13
to Axon Framework Users
Hi Andrea,

do you use a container, like Spring?
To attach transactions to a UnitOfWork, Axon needs a Transaction Manager. Currently, a SpringTransactionManager is the only implementation.
If you use an application managed EntityManager, you may need to create a transaction manager that retrieves the active EntityManager and starts a session on it (and later either commits or rolls back).

Cheers,

Allard


--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Andrea Mariottini

unread,
Aug 1, 2013, 10:36:40 AM8/1/13
to axonfr...@googlegroups.com
I don't have a container like Spring.
I tried to implement a Transaction Manager and all seems to work in memory but nothing is wrote do DB.
I'm investigating...

Thanks,
Andrea


2013/8/1 Allard Buijze <bui...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Axon Framework Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/axonframework/9BlkxQYeNDE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to axonframewor...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Andrea Mariottini
Reply all
Reply to author
Forward
0 new messages