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

StatementlessConnectionEvent when flushing EntityManager #132

Open
phil-nicholls opened this issue Feb 10, 2021 · 1 comment
Open

StatementlessConnectionEvent when flushing EntityManager #132

phil-nicholls opened this issue Feb 10, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@phil-nicholls
Copy link

Hi,

We use a mixture of JOOQ and Hibernate (JOOQ typically for large batch inserts) in our software.
I've noticed that Hypersistence Optimizer is reporting a StatementlessConnectionEvent whenever we flush the EntityManager prior to doing something in JOOQ. For example:

@Transactional
public void delete() {
  em.flush();
  em.clear();
  //some jooq calls...
}

I'm not sure if this is a feature of the software or if I am doing something wrong, or if it's a bug in the code which checks for StatementlessConnection events. I've tried a couple of things, such as putting jooq calls into jooq's simple transaction api, but that still leaves the EntityManager needing to be flushed prior to the jooq calls; and thus the StatementlessConnectionEvent still triggers.

Any advice?

@vladmihalcea
Copy link
Owner

The StatementlessConnectionEvent indicates that the Connection is acquired without executing any statement, but, indeed, it doesn't intercept calls to other frameworks.

Until I figure out a way to address this requirement, you could use a custom EventFilter to filter out those events. Check out this documentation section for an example about event filtering.

@vladmihalcea vladmihalcea added the enhancement New feature or request label Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants