1

I'm new to Spring

I found this information about limitations of event model of Spring:

"It is not transactional. If an event is published, then an error occurs after treatment listeners, they can not be canceled. There there are no means for returning a message published. However, these treatments, if they are executed in the same thread, can participate in the same transaction as that of the sender. This means that if treatments listeners are only operations database, they will also be transactional."

Can someone explain to me the bold sentence? Are database treatments executed by the listener, always made on the same thread as the sender?

gprathour
  • 14,813
  • 5
  • 66
  • 90
Zrom
  • 1,192
  • 11
  • 24

1 Answers1

0

It means that if you send an event, and then during the transaction, the same thread will consume this event and prepare some database changes (the producer and consumer uses the same threat and transaction) all the consumers changes depends on main transaction.

KirkoR
  • 788
  • 6
  • 13
  • Thank you for the response, but what is still not clear is why he says "only database treatments" – Zrom Jul 05 '14 at 14:37
  • Can you describe in more detail what you mean? – KirkoR Jul 07 '14 at 09:00
  • What is not clear for me is the link between the first sentence (However, these treatments, if they are executed in the same thread, can participate in the same transaction as that of the sender) and the second sentence (This means that if treatments listeners are only operations database, they will also be transactional). – Zrom Jul 07 '14 at 12:11