-
1. Re: Synchronized beans
asookazian Nov 12, 2009 11:12 PM (in response to swd847)aren't conversation-scoped beans serialized or synchronized in Seam 2.x?
Seam serializes processing of concurrent requests that take place in the same long-running
conversation context, in the same process.see section 4.1.4. Conversation context of Seam ref doc...
but good question.
-
2. Re: Synchronized beans
asookazian Nov 12, 2009 11:13 PM (in response to swd847)btw, i'm glad somebody is reading the spec. :)
-
3. Re: Synchronized beans
swd847 Nov 12, 2009 11:23 PM (in response to swd847)Yes, but I want to know if this is part of the core weld functionality, or something that seam 3 will add on. Not just with regard to serialization of conversation access, but also the automatic synchronization of session scoped beans.
-
4. Re: Synchronized beans
asookazian Nov 13, 2009 12:02 AM (in response to swd847)so otherwise the programmer will have to deal with synchronization code in a multi-threaded environment like synchronized(this). This type of code was not required AFAIK in Seam programming.
Thread-safety is something that the EJB component model offers out-of-the-box for session beans. I'd imagine Weld/CDI would do the same...
good question, I'm interested in the official answer...
-
5. Re: Synchronized beans
gavin.king Nov 13, 2009 12:10 AM (in response to swd847)
Stuart Douglas wrote on Nov 12, 2009 22:18:
I just had a quick look through the spec and I could not see anything about synchronizing access to beans, is this something that Seam 3 will address or have I missed something?Yes, I'm sure Seam3 will provide an interceptor for this. Note that EJB 3.1 also features some sophisticated concurrency primitives - that evolved from my suggestions to the EG ;-)
-
6. Re: Synchronized beans
asookazian Nov 13, 2009 12:19 AM (in response to swd847)wait. wasn't there a recent thread here in which you or Nicklas stated that interceptors will not be available in Weld or Seam 3? So the @BypassInterceptors annotation would no longer be required as a performance optimization?
-
7. Re: Synchronized beans
swd847 Nov 13, 2009 12:24 AM (in response to swd847)They did not say that they will not be available, they form part of the CDI spec. The main difference is that all injections no longer have to be done on all method invocations, so the old seam bijection interceptor is no longer needed. There will still be interceptors, you need them to implement things like @Transactional.
-
8. Re: Synchronized beans
gavin.king Nov 13, 2009 12:38 AM (in response to swd847)Right, the difference is that there are no interceptors by default.