public class MultiThreadedIssues implements Runnable
{
public static void main(String[] args)
{
for (int i = 0; i < 10; i++)
{
new Thread(new MultiThreadedIssues()).start();
}
}
public void run()
{
Connection c;
Statement s;
try
{
c =
DriverManager.getConnection("jdbc:h2:mem:a;MULTI_THREADED=TRUE", "sa", "sa");
s = c.createStatement();
for (int i = 0; i < 100; i++)
{
s.execute("CREATE TABLE IF NOT EXISTS user (id INT, val
VARCHAR(200))");
}
} catch (SQLException e)
{
e.printStackTrace();
}
}
}
If no MULTI_THREADED=TRUE ,this will be alright.
version: 185
--
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/d/optout.