I have wrapped all of my individual SELECT statements in
transactional() blocks. However this causes each statement to wrapped
in BEGIN .. ROLLBACK.
transactional() =>
LOG: execute S_1: BEGIN
LOG: execute <unnamed>: SELECT * FROM attributes WHERE attribute_id =
$1
DETAIL: parameters: $1 = '1043'
LOG: execute S_2: ROLLBACK
LOG: execute S_1: BEGIN
LOG: execute <unnamed>: SELECT * FROM attributes WHERE attribute_id =
$1
DETAIL: parameters: $1 = '1044'
LOG: execute S_2: ROLLBACK
If i change them to transaction() blocks I get =>
LOG: execute S_1: BEGIN
LOG: execute <unnamed>: SELECT * FROM attributes WHERE attribute_id =
$1
DETAIL: parameters: $1 = '1039'
LOG: execute S_2: COMMIT
LOG: execute S_1: BEGIN
LOG: execute <unnamed>: SELECT * FROM attributes WHERE attribute_id =
$1
DETAIL: parameters: $1 = '1040'
LOG: execute S_2: COMMIT
If I change them to readOnly() blocks I get =>
LOG: execute <unnamed>: SET SESSION CHARACTERISTICS AS TRANSACTION
READ ONLY
LOG: execute S_1: BEGIN
LOG: execute <unnamed>: SELECT * FROM attributes WHERE attribute_id =
$1
DETAIL: parameters: $1 = '1065'
LOG: execute S_2: ROLLBACK
LOG: execute <unnamed>: SET SESSION CHARACTERISTICS AS TRANSACTION
READ ONLY
LOG: execute S_1: BEGIN
LOG: execute <unnamed>: SELECT * FROM attributes WHERE attribute_id =
$1
DETAIL: parameters: $1 = '1069'
LOG: execute S_2: ROLLBACK
My question is, is there a way to use orbroker so that when one
transaction is started, future statements will not try to start their
own transactions?? Should I somehow set up my 'select' functions so
that they receive an implicit transaction?
Code is here:
https://github.com/atistler/mailproc/tree/master/src/main/scala/db