We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@Autowired private FooDao fooDao; @Autowired private BarDao barDao; @Autowired private Jdbi jdbi; public saveFooBar1() { jdbi.useTransaction(handle -> { // transaction not open long insertedId = fooDao.insert(new Foo()); barDao.insert(new Bar(insertedId)); // open transaction because BarDao.insert() have @Transaction }); } public saveFooBar2() { jdbi.useTransaction(handle -> { FooDao fooDao = handle.attach(FooDao.class); BarDao barDao = handle.attach(BarDao.class); // transaction open long insertedId = fooDao.insert(new Foo()); barDao.insert(new Bar(insertedId)); // transaction not open despite BarDao.insert() have @Transaction }); }
in the case of saveFooBar1(), is this the expected behavior or am I doing something wrong? I Expected behavior as in saveFooBar2() method
The text was updated successfully, but these errors were encountered:
No branches or pull requests
in the case of saveFooBar1(), is this the expected behavior or am I doing something wrong?
I Expected behavior as in saveFooBar2() method
The text was updated successfully, but these errors were encountered: