Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

transactions in jdbi

I execute sql queries as transactions using jdbi inTransaction() function. I would like to know how/what type of locking mechanism is used internally. additionally, is the whole table locked during the transaction or just the record that has to be updated?

like image 959
FSP Avatar asked Nov 16 '11 20:11

FSP


Video Answer


2 Answers

The transaction is purely at the database level. It will use the default isolation level for the database/connection unless overridden.

If you are using the inTransaction(...) method which accepts a callback, there is a form of that function which allows for you to set the isolation level:

<ReturnType> ReturnType inTransaction(TransactionIsolationLevel level,
                                      TransactionCallback<ReturnType> callback)

-Brian

like image 116
brianm Avatar answered Sep 19 '22 22:09

brianm


It depends on transaction isolation level. Isolation

like image 21
Alexandr Avatar answered Sep 18 '22 22:09

Alexandr