I have 4 threads executed in compliance (insert / select rows to / from the database), should I take care of access synchronization or H2 Databsedoes it already have a mechanism for controlling access between threads?
H2 Databse
PS: the variable Connection connis shared between threads, so the connection is done once, because I use the built-in mode, so only one connection is allowed.
Connection conn
Greetings.
. , ( , ), - ( ).
H2:
: , . .
H2, . ( , , , - - , - .) , , H2: JDBC , ( , ), .
, autocommit ( , JDBC ), ( . Mark R autocommit). , JDBC ( autocommit false commit ), ( , , JDBC-, call commit, ), . , commit , , .
- . , SQL- , .
, , . , , concurrency.
, .
():
- Avoid complex queries which take a lot of time - use the abbility of multiple connections by creating independent clients which communicate with the server. - look at patterns and anti-atterns concenring this issue
,