-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Provide out of the box implementation of the thread scope [SPR-2581] #7270
Comments
Claus Ibsen commented Eugene should you not also link to your excellent blog about a real life use-case for this scope? http://jroller.com/page/eu?entry=implementing_efficinet_id_generator |
Claus Nielsen commented I'd also really like to see this in Spring, and thought I'd mention another usecase. [code]
[/code] This worked very well until we put it in a multithreaded application. Then we started getting protocol exceptions from httpClient. [code]
[/code] |
David Winterfeldt commented I made an implementation that can support destruction callbacks as long as the Thread or Runnable make a call when they finish. There is currently a Runnable that can be a wrapper for another Runnable that will always make the call when it finishes so destruction callbacks occur. More information can be found on this wiki and it's also available for checkout from subversion. It's also available for download as a Maven artifact if anyone wants to use it before Spring includes an implementation of this in a release. http://www.springbyexample.org/twiki/bin/view/Example/CustomThreadScopeModule http://svn.springbyexample.org/custom-thread-scope/trunk <dependency> |
Jorg Heymans commented
|
Arjen Poutsma commented I've added Eugene's version, see |
Eugene Kuleshov opened SPR-2581 and commented
Thread-bound scope can help to address concurrency issues (e.g. batching up requests per thread). So, it would be really handy if Spring provided such scope out of the box for Spring 2.0. E.g. something like this:
Affects: 2.0 final
Referenced from: commits ad2cc34
16 votes, 22 watchers
The text was updated successfully, but these errors were encountered: