Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8009

Fail append rows into table in transaction via java API of mongodb

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: WT3.2.1
    • Component/s: APIs, Transactions
    • Environment:
      Ubuntu 20.04
      Java 8 and 11
    • 5
    • Storage - Ra 2021-09-06, Storage - Ra 2021-10-04, Storage - Ra 2021-10-18

      I build wiredtiger for the version which is used in MongoDB 4.2 and I am interested in the ACID transaction of wiredtiger. However, I found that there is something wrong with the Java API when executing "row append" in a transaction.

      My sample code cound be found in Ubuntu Pastebin

      // Bash
      [1630049291:287934][473483:0x7f6896f9f700], WT_SESSION.commit_transaction: __session_commit_transaction, 1638: failed transaction requires rollback: 无效的参数[1630049291:287934][473483:0x7f6896f9f700], WT_SESSION.commit_transaction: __session_commit_transaction, 1638: failed transaction requires rollback: 无效的参数com.wiredtiger.db.WiredTigerException: 无效的参数 at com.wiredtiger.db.wiredtigerJNI.Session_commit_transaction(Native Method) at com.wiredtiger.db.Session.commit_transaction(Session.java:189) at ex_snapshot_append.appendExample(ex_snapshot_append.java:63) at ex_snapshot_append.main(ex_snapshot_append.java:83)[1630049291:288452][473483:0x7f6896f9f700], WT_SESSION.rollback_transaction: __wt_txn_context_check, 57: only permitted in a running transaction: 无效的参数Exception: com.wiredtiger.db.WiredTigerException: 无效的参数com.wiredtiger.db.WiredTigerException: 无效的参数 at com.wiredtiger.db.wiredtigerJNI.Session_rollback_transaction(Native Method) at com.wiredtiger.db.Session.rollback_transaction(Session.java:205) at ex_snapshot_append.appendExample(ex_snapshot_append.java:66) at ex_snapshot_append.main(ex_snapshot_append.java:83)
      

      The same operation could be successfully executed in C API, but failed in Java. Is there something wrong of my code?

       

            Assignee:
            siddhartha.mahajan@mongodb.com Sid Mahajan
            Reporter:
            tsunaouyang@gmail.com Ouyang Tsuna
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: