Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start transaction and rollback with JOOQ?

Yes! I have read the docs about

  • jOOQ will never commit or rollback on the Connection (Except for CSV-imports, if explicitly configured in the Import API)
  • jOOQ will never start any transactions.
  • ...

but when I need some transaction management, what is the best practice to do this?

Have I said that I'm a big fan of a way of JOOQ!

like image 638
Mark Avatar asked Mar 01 '13 14:03

Mark


1 Answers

Transaction control is independent of a DB access layer like what JOOQ provides.

Starting and finishing transactions is probably best handled in the Service Layer of your application. See the diagram at that page showing the Service Layer's relationship to lower layers it calls.

See also patterns like Unit of Work or Transaction Script.

like image 61
Bill Karwin Avatar answered Sep 17 '22 11:09

Bill Karwin