Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application level transaction handling #47

Closed
isuru89 opened this issue Oct 6, 2017 · 0 comments
Closed

Application level transaction handling #47

isuru89 opened this issue Oct 6, 2017 · 0 comments
Assignees
Milestone

Comments

@isuru89
Copy link
Contributor

isuru89 commented Oct 6, 2017

It it nice to have to handle a transaction from application level without embedding business logic in query scripts.

NyQLInstance nyqlInstance = ...
nyqlInstance.doTransaction("transactionId", (nyqlInst, data) -> {
        // your business logic here
        // NOTE: always use provided NyQLInstance instead of the instance in parent scope
    }, 
    data,  // map of data which will be send to the transaction body
    true    // whether to auto commit or not
);

Transaction body is a BiFunction which has inputs of current NyQLInstance and the map of data. In case user wants to execute other non-transactional scripts from inside transaction body, the provided NyQLInstance must be used.

WARN: User never can call another transactional scripts/queries from inside the transaction body.

@isuru89 isuru89 added this to the v2.0 milestone Oct 6, 2017
@isuru89 isuru89 self-assigned this Oct 6, 2017
@isuru89 isuru89 closed this as completed Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant