Error on Event handler

86 views
Skip to first unread message

Harvey Sama

unread,
Aug 11, 2017, 2:47:33 PM8/11/17
to Axon Framework Users
Hi, 
I get this error when trying to run a command

Command XYZ resulted in org.springframework.transaction.TransactionSystemException(Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction)

Any idea what may be wrong?

Steven van Beelen

unread,
Aug 15, 2017, 6:06:43 AM8/15/17
to Axon Framework Users
Hi Harvey,

Is that a consistent error or only in some scenarios?
I find it hard to figure out what the issue is based on just the exception, but it sounds like appending the event to the event store went wrong.
How is your event store configured? Maybe that can shed some light on your issue.

Cheers,

Steven

--
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/d/optout.

Harvey Sama

unread,
Aug 15, 2017, 4:21:38 PM8/15/17
to Axon Framework Users
Hi Stephen,

This happens only  when trying to update a certain aggregate, and consequently the view from the events of the aggregate. Other aggregates don't have this problem, so that's what puzzles me.

The event store is automatically created by axon at application start right? I don't have any explicit configuration for it. The only time I configure an event store is when I autowire it for snapshot configuration which I've not yet done.



Best Regards,

Harvey Sama


To unsubscribe from this group and stop receiving emails from it, send an email to axonframework+unsubscribe@googlegroups.com.

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

--
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/CxqrsA-sWiE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to axonframework+unsubscribe@googlegroups.com.

Allard Buijze

unread,
Aug 16, 2017, 4:18:42 AM8/16/17
to Axon Framework Users
Hi Harvey,

this error occurs when a transaction cannot be committed, because it has been marked as "rollback only". Hibernate does this automatically when an operation on the EntityManager (such as a query) fails to execute. This may be the case in your Event Handlers that update the query model, or by Axon when it's inserting an Event in the EventStore.

Exceptions in Event Handlers are logged by default. If there is an error in command handling, it is reported as a result of the command. Do you use the CommandGateway or the CommandBus to dispatch your commands. Do you use Sagas? If so, which one do they use?

Make sure you log the (Exception) result of commands send. Axon doesn't log these (since it reports them using the API). Note that the CommandGateway.send() method returns a CompletableFuture. You can use that CompletableFuture to discover if there are any errors processing a command.

Hope this helps.
Cheers,

Allard

Op di 15 aug. 2017 om 22:21 schreef Harvey Sama <prince...@gmail.com>:
Hi Stephen,

This happens only  when trying to update a certain aggregate, and consequently the view from the events of the aggregate. Other aggregates don't have this problem, so that's what puzzles me.

The event store is automatically created by axon at application start right? I don't have any explicit configuration for it. The only time I configure an event store is when I autowire it for snapshot configuration which I've not yet done.



Best Regards,

Harvey Sama


On 15 August 2017 at 11:06, Steven van Beelen <steven.v...@axoniq.io> wrote:
Hi Harvey,

Is that a consistent error or only in some scenarios?
I find it hard to figure out what the issue is based on just the exception, but it sounds like appending the event to the event store went wrong.
How is your event store configured? Maybe that can shed some light on your issue.

Cheers,

Steven

On Fri, Aug 11, 2017 at 8:47 PM Harvey Sama <prince...@gmail.com> wrote:
Hi, 
I get this error when trying to run a command

Command XYZ resulted in org.springframework.transaction.TransactionSystemException(Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction)

Any idea what may be wrong?

--
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/d/optout.

--
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/CxqrsA-sWiE/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/d/optout.

--
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.

Harvey Sama

unread,
Aug 17, 2017, 1:16:32 PM8/17/17
to Axon Framework Users
Thank you Allard. I use the CommandGateway. I've registered a callback and now get the source of the error.
Reply all
Reply to author
Forward
0 new messages