withNewSession vs. persistenceInterceptor.init()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

withNewSession vs. persistenceInterceptor.init()

longwa
We've been using the Executor plugin for awhile, but it seems somewhat out of date. I notice in the GormAsyncStaticApi that the decorator for the promise API simply does a withNewSession() instead of anything more elaborate. Following the implementation, it seems like withNewSession() vs. the persistenceInterceptor.init() -> flush() -> destroy() are fairly different in implementation.

Would there be any expected behavior differences between using one vs. the other? We continue to see some unexplainable session behavior in a few places and want to make sure we aren't doing anything weird with our threading model.

If withNewSession() is all that's needed, seems like maybe an update to the executor plugin to just wrap or use the Promise API might be in order.

-Aaron


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/bf4f5eb0-01d8-47b6-96bf-347e85f42063%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: withNewSession vs. persistenceInterceptor.init()

Graeme Rocher-2
Is the executor plugin still necessary given the async support?

Cheers

Graeme Rocher
Grails Project lead
OCI - http://ociweb.com


On Mon, Aug 24, 2015 at 4:41 PM, Aaron <[hidden email]> wrote:

We've been using the Executor plugin for awhile, but it seems somewhat out of date. I notice in the GormAsyncStaticApi that the decorator for the promise API simply does a withNewSession() instead of anything more elaborate. Following the implementation, it seems like withNewSession() vs. the persistenceInterceptor.init() -> flush() -> destroy() are fairly different in implementation.

Would there be any expected behavior differences between using one vs. the other? We continue to see some unexplainable session behavior in a few places and want to make sure we aren't doing anything weird with our threading model.

If withNewSession() is all that's needed, seems like maybe an update to the executor plugin to just wrap or use the Promise API might be in order.

-Aaron


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/bf4f5eb0-01d8-47b6-96bf-347e85f42063%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/1440602003981.13974903%40Nodemailer.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: withNewSession vs. persistenceInterceptor.init()

longwa
It's really needed more for integration with existing libraries and API's.

For example, when defining service-activators in spring, you can give an executorService bean reference that needs to conform to that API. It's useful to have that automatically wrapped in persistence context.

For simple backgrounding, the Promise API is much better.

Shouldn't the executor service be using the same wrapping mechanism as the Promise API decorators?

-Aaron

On Wednesday, August 26, 2015 at 11:13:25 AM UTC-4, Graeme Rocher wrote:
Is the executor plugin still necessary given the async support?

Cheers

Graeme Rocher
Grails Project lead
OCI - <a href="http://ociweb.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fociweb.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGzeZwvqKHLWu--y_uuay6-1VkagA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fociweb.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGzeZwvqKHLWu--y_uuay6-1VkagA&#39;;return true;">http://ociweb.com


On Mon, Aug 24, 2015 at 4:41 PM, Aaron <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="NWr_NILVEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">lon...@...> wrote:

We've been using the Executor plugin for awhile, but it seems somewhat out of date. I notice in the GormAsyncStaticApi that the decorator for the promise API simply does a withNewSession() instead of anything more elaborate. Following the implementation, it seems like withNewSession() vs. the persistenceInterceptor.init() -> flush() -> destroy() are fairly different in implementation.

Would there be any expected behavior differences between using one vs. the other? We continue to see some unexplainable session behavior in a few places and want to make sure we aren't doing anything weird with our threading model.

If withNewSession() is all that's needed, seems like maybe an update to the executor plugin to just wrap or use the Promise API might be in order.

-Aaron


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NWr_NILVEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-dev-discuss+unsubscribe@....
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NWr_NILVEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/grails-dev-discuss/bf4f5eb0-01d8-47b6-96bf-347e85f42063%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/bf4f5eb0-01d8-47b6-96bf-347e85f42063%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/bf4f5eb0-01d8-47b6-96bf-347e85f42063%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;">https://groups.google.com/d/msgid/grails-dev-discuss/bf4f5eb0-01d8-47b6-96bf-347e85f42063%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/372d1cd0-63d7-4180-9d84-622e4e0b73cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.