0

TokuMx取引を整理するために使用しています。そのための特定のコマンドがあります。

で走ってみdb.runCommand("beginTransaction")ましたMongo shell。うまくいきました。

しかし、私が同じことをしたときJongo

PlayJongo.jongo().runCommand("beginTransaction");

それは私にくれました[error] play - Cannot invoke the action, eventually got an error: java.lang.IllegalArgumentException: Cannot parse query: beginTransaction

私は何を間違えましたか?

編集

public static boolean buyProduct(User buyer, User seller, int accountIndex, float productPrice){
    boolean isSuccess = false;
    PlayJongo.jongo().runCommand("{beginTransaction : 1}");
    try{
        // Deposit money to seller
        seller.getAccounts().get(0).deposit(productPrice);
        UserRepository.update(seller);
        // Withdraw money from buyer
        buyer.getAccounts().get(accountIndex).withdraw(productPrice);
        UserRepository.update(buyer);
        throw new Exception();
        //isSuccess = true;
    }
    catch (Exception e){
        PlayJongo.jongo().runCommand("{rollbackTransaction : 1 }");
        isSuccess = false;
    }

    return isSuccess;
}
4

1 に答える 1

2

私はジョンゴの専門家ではありませんが、tokumx に取り組んでおり、ジョンゴのドキュメントを確認しました。私はあなたが欲しいと思います

PlayJongo.jongo().runCommand("{beginTransaction:1}");
于 2014-06-25T17:13:43.110 に答える