Wednesday, 15 May 2013

java - Marklogic XCC cannot commit without an active transaction -



java - Marklogic XCC cannot commit without an active transaction -

i having issue mark logic.i using xcc/j api. have multi-statment transaction , doing below.

session sess = contentsource.newsession(); sess.settransactionmode(transactionmode.update) ....perform queries..... session.commit();

but maintain getting illegalstateexception cannot commit without active transaction

from java application developer's guide:

to start transaction , obtain transaction object, phone call opentransaction() method on databaseclient object (since transaction controls if database changes made). phone call opentransaction(), application must authenticate rest-writer or rest-admin.

transaction transaction = client.opentransaction();

looks don't have in sample code, think missed step of starting transaction.

java marklogic

No comments:

Post a Comment