Hi,

Using multiple threads against the same transaction is not supported or
tested, I'm sorry.

Regards,
Thomas

On Wed, Feb 8, 2017 at 3:55 PM, Roland Lohner <loc...@gmail.com> wrote:

> Dear MVStore developers,
>
> I have a question regarding concurrent access of a TransactionMap in one
> transaction.
>
> I create a Transaction and a TransactionMap.
>
> transaction = transactionStore.begin();
> map = transaction.openMap(name);
>
> When multiple threads access this map and do a put operation concurrently
> the following exception occurs:
>
> java.lang.IllegalStateException: An old transaction with the same id is
> still open: 1 [1.4.193/102]
>     at org.h2.mvstore.DataUtils.newIllegalStateException(
> DataUtils.java:765)
>     at org.h2.mvstore.db.TransactionStore.log(TransactionStore.java:275)
>     at org.h2.mvstore.db.TransactionStore$Transaction.
> log(TransactionStore.java:706)
>     at org.h2.mvstore.db.TransactionStore$TransactionMap.trySet(
> TransactionStore.java:1104)
>     at org.h2.mvstore.db.TransactionStore$TransactionMap.set(
> TransactionStore.java:1027)
>     at org.h2.mvstore.db.TransactionStore$TransactionMap.put(
> TransactionStore.java:1005)
>
> Synchronizing org.h2.mvstore.db.TransactionStore.TransactionMap.put(K, V)
> using the TransactionMap itself solves the problem.
>   synchronized(map) {
>       map.put(key, value);
>   }
>
>
> My question is whether this behavior is intentional as MVStore supports
> only 'one transaction - one thread model'?
> Or did I find a bug around 
> org.h2.mvstore.db.TransactionStore.Transaction.log(int,
> Object, Object)?
> (As concurrent threads can log in same transaction with same logId=0)
>
> Thanks in advance,
> Roland
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to h2-database+unsubscr...@googlegroups.com.
> To post to this group, send email to h2-database@googlegroups.com.
> Visit this group at https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to