On Monday, December 30, 2013 5:38:46 PM UTC-8, Kartweel wrote:
>
>  It will be 2.
>

Thanks.
 

> and the second create table will fail because the table already exists.
>

Yep; thanks.
 

> But I don't see how that has anything to do with being thread safe?
>

I'm sure I worded it badly.  I am trying to see how best to run parallel 
unit tests using the 
maven-surefire-plugin,<http://lairdnelson.wordpress.com/2013/09/25/concurrent-testing/>where
 you can control parallelism at the process and thread level.  I 
didn't see anything in the H2 documentation about whether a "mem" database 
was one-per-process or one-per-thread.
 

> The in memory database is per process, so all threads access the same 
> database.
>

Thank you; this is what I was looking for.  Is there a spot in the 
documentation that says this explicitly?
 

> If you want a separate database per thread then give the databases 
> different names.
>

That has been my approach so far; it dawned on me (wrongly, as it turns 
out) that perhaps I was overengineering something—that perhaps jdbc:h2:mem 
was enough for a private per-thread database, but as you point out it is 
not.  Thanks for your time and the clarity of your response.

Best,
Laird

--
http://about.me/lairdnelson

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