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
Reject stream executions if not executed within transaction [DATAJPA-1023] #1369
Comments
Oliver Drotbohm commented Do you run transactions in AspectJ mode? If not, adding |
Maarten Hus commented Thank you Thanks again for your lighting fast response (y) |
Oliver Drotbohm commented No worries, glad we got it working for you. We're currently investigating to even throw an exception in case we detect the transactions not being set up correctly when executing a method using |
Oliver Drotbohm commented This is now in place. A stream execution now checks whether there has been a transaction in place before the repository was invoked. If that's not the case, we reject the execution and give an indication why this is happening. This should give you a better idea of why things are not working in case you accidentally run into some misconfiguration like the one shown above |
Neale Upstone commented It's good to have this in place. Oliver. Can you clarify the original behaviour and limitations of the new behaviour (I thought it's best to add it here as this is where we end up from the release notes). The original behaviour seems to be a connection leakage either in Data JPA or in the underlying JPA provider's streaming support.
|
Alexander Simeonov commented
|
Maarten Hus opened DATAJPA-1023 and commented
I'm using Stream's to loop through each element in a Repository in an
@Scheduled
method. After running 200 times I get the following error:The Repository is defined as such:
The Service is defined like this:
I've tried using
@Transactional
( readOnly=true) but it does not make a difference.Affects: 1.10.5 (Hopper SR5)
Issue Links:
("depends on")
("is duplicated by")
Backported to: 1.11 RC1 (Ingalls)
The text was updated successfully, but these errors were encountered: