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

connection leak when rollback #628

Closed
ddyycao opened this issue Jul 19, 2017 · 1 comment
Closed

connection leak when rollback #628

ddyycao opened this issue Jul 19, 2017 · 1 comment
Labels

Comments

@ddyycao
Copy link

ddyycao commented Jul 19, 2017

@Override
    public <V> V runInTransaction(Callable<V> callable, @Nullable TransactionIsolation isolation) {
        Objects.requireNotNull(callable);
        checkClosed();
        Transaction transaction = transactionProvider.get();
        if (transaction == null) {
            throw new TransactionException("no transaction");
        }
        try {
            transaction.begin(isolation);
            V result = callable.call();
            transaction.commit();  // will close connection
            return result;
        } catch (Exception e) {
            transaction.rollback();  //doesn't close connection
            throw new RollbackException(e);
        }
    }

transaction.rollback() in runInTransaction doesn't close connection,and cause connection leak

@npurushe
Copy link
Contributor

Thanks for reporting, will be fixed in an upcoming update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants