It will be 2. and the second create table will fail because the table already exists. But I don't see how that has anything to do with being thread safe? The in memory database is per process, so all threads access the same database. If you want a separate database per thread then give the databases different names.



On 31/12/2013 7:50 AM, Laird Nelson wrote:
On Tuesday, October 8, 2013 10:24:12 AM UTC-7, Thomas Mueller wrote:

    I think the documentation is quite clear.


Let me rephrase the question (and sorry for just now noticing the timely reply):

Suppose I have two threads, t1 and t2. Suppose each of them opens a connection to jdbc:h2:mem: Suppose that each of them now issues a CREATE TABLE Fred statement. Suppose further that each of them now inserts one row into the Fred table.

If t1 then issues a SELECT COUNT(*) FROM Fred, and if no other database activity takes place, will the result be /guaranteed/ to be 1? Or will it be 2?

Thanks,
Best,
Laird
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to