rxjava2-jdbc icon indicating copy to clipboard operation
rxjava2-jdbc copied to clipboard

Simple insert with transaction is not happening

Open alwinjosh opened this issue 8 years ago • 6 comments

Trying to execute following insert query does not commit transaction due to transaction reference counter is not decremented.

db.update( "INSERT INTO ADDRESS_REL (ADDRESS_ID, ADDRESS_DETAILS ) VALUES ( ?, ? )") .parameterStream(Flowable.just(105L, "Address of 105")) .transacted() .counts() .blockingSubscribe(tx -> System.out.println(tx.isComplete() ? "complete" : tx.value()));

Do I missed any hint to transaction ?

alwinjosh avatar Dec 18 '17 18:12 alwinjosh

Thanks for report, I'll have a look soon.

On Tue, 19 Dec. 2017, 04:39 alwinjosh, [email protected] wrote:

Trying to execute following insert query does not commit transaction due to transaction reference counter is not decremented.

db.update( "INSERT INTO ADDRESS_REL (ADDRESS_ID, ADDRESS_DETAILS ) VALUES ( ?, ? )") .parameterStream(Flowable.just(105L, "Address of 105")) .transacted() .counts() .blockingSubscribe(tx -> System.out.println(tx.isComplete() ? "complete" : tx.value()));

Do I missed any hint to transaction ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/davidmoten/rxjava2-jdbc/issues/13, or mute the thread https://github.com/notifications/unsubscribe-auth/AATa61qAFts9mBsHofDNesWu5GYmIqmjks5tBqpIgaJpZM4RF3PV .

davidmoten avatar Dec 19 '17 00:12 davidmoten

Yep, update/insert transactions need work. That case wasn't tested for. I'll see what I can do, plus I notice that the transactions generally needs more documentation.

davidmoten avatar Dec 22 '17 21:12 davidmoten

Is it still the problem ? Could you give an example how to make two updates/inserts in one transaction ?

pkziel avatar Mar 26 '18 08:03 pkziel

oops, I'll revisit this

davidmoten avatar Apr 02 '18 11:04 davidmoten

i have a same problem... is this fixed???

yonghun8343 avatar Apr 09 '19 17:04 yonghun8343

Thanks for the reminder. I guess it's not fixed yet, I'll have a look soon.

davidmoten avatar Apr 09 '19 23:04 davidmoten