02-13-2007 02:52 PM
02-14-2007 08:15 PM
If this should be in the JCR-RMI plugin forum, let me know. Anyway, we currently embed Alfresco within our app, and would like to move it out as a separate service. We would also like to move to the standard JCR API in the process. It looks like, for now, that means JCR over RMI. However, we make heavy use of transactions and need Alfresco to participate in them (we are currently using Spring + JOTM, but will be moving away from JOTM shortly). Does JCR-RMI support this in any way? Forum searches are turning up similar questions, but no answers. Also, does Alfresco cope with the fact that RMI calls in a JCR session can happen over different threads?
Thanks in advance.
Anyway, we currently embed Alfresco within our app, and would like to move it out as a separate service. We would also like to move to the standard JCR API in the process.
Anyway, we currently embed Alfresco within our app, and would like to move it out as a separate service.
Also, does Alfresco cope with the fact that RMI calls in a JCR session can happen over different threads?You are saying you are going to share the same session with multiple threads? There is a one Session / Thread limitation on the implementation side
02-14-2007 08:17 PM
If this should be in the JCR-RMI plugin forum, let me know. Anyway, we currently embed Alfresco within our app, and would like to move it out as a separate service. We would also like to move to the standard JCR API in the process. It looks like, for now, that means JCR over RMI. However, we make heavy use of transactions and need Alfresco to participate in them (we are currently using Spring + JOTM, but will be moving away from JOTM shortly). Does JCR-RMI support this in any way? Forum searches are turning up similar questions, but no answers. Also, does Alfresco cope with the fact that RMI calls in a JCR session can happen over different threads?
Thanks in advance.
Anyway, we currently embed Alfresco within our app, and would like to move it out as a separate service. We would also like to move to the standard JCR API in the process.
Anyway, we currently embed Alfresco within our app, and would like to move it out as a separate service.
Also, does Alfresco cope with the fact that RMI calls in a JCR session can happen over different threads?You are saying you are going to share the same session with multiple threads? There is a one Session / Thread limitation on the implementation side
02-14-2007 08:33 PM
You are saying you are going to share the same session with multiple threads? There is a one Session / Thread limitation on the implementation sideNo, what I meant is that when the client of an RMI proxied interface invokes methods against that proxy (all in the same thread on the client side), most RMI implementations I've worked with end up invoking the proxied method from different threads on the server side. So, if the client does something like this:
- Client Thread 1 -
service.method1();
service.method2();
service.method3();It can end up like this on the server (mostly depending on server load):- Server Thread 1 -
service.method1();
- Server Thread 2 -
service.method2();
- Server Thread 1 -
service.method3();At any rate, thread locals end up being very unreliable once you export something via RMI, and I know that Spring transaction management, Hibernate session management, and Acegi authentication management all use thread locals to maintain transaction, session, and security context.
02-14-2007 09:24 PM
You are saying you are going to share the same session with multiple threads? There is a one Session / Thread limitation on the implementation sideNo, what I meant is that when the client of an RMI proxied interface invokes methods against that proxy (all in the same thread on the client side), most RMI implementations I've worked with end up invoking the proxied method from different threads on the server side. So, if the client does something like this:It can end up like this on the server (mostly depending on server load):- Client Thread 1 -
service.method1();
service.method2();
service.method3();At any rate, thread locals end up being very unreliable once you export something via RMI, and I know that Spring transaction management, Hibernate session management, and Acegi authentication management all use thread locals to maintain transaction, session, and security context.- Server Thread 1 -
service.method1();
- Server Thread 2 -
service.method2();
- Server Thread 1 -
service.method3();
02-15-2007 11:30 AM
… Speaking of thread locals… what on earth is the fetish in the java community for using this techique? It's not exactly a small design decision… as you said it can have serious implications on how your implementation can be used.I don't like thread locals a whole lot, but Java provides few (any?) alternatives if you want to have some kind of context for your executing code. Context like current transaction, current authentication, etc. I suppose you could always pass needed context around as parameters to every method you invoke… but that's just not practical for obvious reasons.
02-15-2007 11:05 PM
… Speaking of thread locals… what on earth is the fetish in the java community for using this technique? It's not exactly a small design decision… as you said it can have serious implications on how your implementation can be used.I don't like thread locals a whole lot, but Java provides few (any?) alternatives if you want to have some kind of context for your executing code. Context like current transaction, current authentication, etc. I suppose you could always pass needed context around as parameters to every method you invoke… but that's just not practical for obvious reasons.
One idea as an alternative to thread local would be "stack local" variables. They would work in a similar way to thread local, except they would be local to the current method on the call stack, and any methods invoked within the current method (and so on, to any depth). Thus, a method could setup a transaction, put it into a stack local variable, and any methods executed from there are all done within that transaction. Once the main method unwinds, the transaction goes out of scope. With that in place, the next thing I'd like to see is the ability to manipulate the call stack: detach it from the thread, store it away, pull it out later, reattach it to any thread, continue execution, etc. This would make continuations possible, along with thread migration, etc. With these two things, all sorts of amazing stuff could be done… but these two things would require changes to the JVM. Oh well…
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.