Do I need to manage concurrency regarding database access?

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?

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.

Greetings.

+4
source share
2 answers

. , ( , ), - ( ).

H2:

: , . .

H2, . ( , , , - - , - .) , , H2: JDBC , ( , ), .

, autocommit ( , JDBC ), ( . Mark R autocommit). , JDBC ( autocommit false commit ), ( , , JDBC-, call commit, ), . , commit , , .

- . , SQL- , .

+6

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

,

+1

All Articles