DML and transaction boundaries

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DML and transaction boundaries

Vladimir Ozerov
Igniters,

Our docs say that DML statements are executed outside of current
transaction. This is not true - it is enlisted into transaction at the
moment. We need to fix that, but how?

Possible solutions:
1) Execute DML outside of TX, similar to current IgniteCache#getAllOutTx
2) Or throw an exception - DML cannot be executed inside TX at all

I prefer the second. For now DML inside TX simply doesn't make sense. It is
prone to deadlocks and has unpredictable semantics. Let's restrict it
explicitly.

Thoughts?

Vladimir.
Reply | Threaded
Open this post in threaded view
|

Re: DML and transaction boundaries

dsetrakyan
I prefer the (3) - print out a warning in the log. Otherwise, if you throw
an exception, you are risking breaking all the existing user code.

On Wed, Aug 23, 2017 at 7:20 AM, Vladimir Ozerov <[hidden email]>
wrote:

> Igniters,
>
> Our docs say that DML statements are executed outside of current
> transaction. This is not true - it is enlisted into transaction at the
> moment. We need to fix that, but how?
>
> Possible solutions:
> 1) Execute DML outside of TX, similar to current IgniteCache#getAllOutTx
> 2) Or throw an exception - DML cannot be executed inside TX at all
>
> I prefer the second. For now DML inside TX simply doesn't make sense. It is
> prone to deadlocks and has unpredictable semantics. Let's restrict it
> explicitly.
>
> Thoughts?
>
> Vladimir.
>