Author |
Message |
06/25/2007 07:07:27
|
aldarana
neo
Joined: 06/21/2007 09:02:34
Messages: 8
Offline
|
Hi, I've to instrument an spring application and I want replicate the sessions.
I put a prototype bean (transactional bean) in session but When the application put in session this bean,
terracotta try to instrument a lot of spring AOP classes. (include DataSource)
Anyone has the same problem? the problem is that we use an prototype manager (use case controller) for every different use cases.
thanks in advance
Simone
|
|
|
06/25/2007 14:28:58
|
teck
seraphim
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline
|
Hi there,
I forwarded this thread to one of our Spring+DSO experts over here. In the meantime, what is the issue exactly? Is there an exception being thrown, or are simply too many classes getting instrumented. If the latter, what issue is that causing?
|
Tim Eck (terracotta engineer)
|
|
|
06/25/2007 14:45:37
|
ekulesho
master
Joined: 12/04/2006 08:49:08
Messages: 57
Offline
|
Simone, the easiest way to deal with this issue is to extract all your session data into separate session-scoped bean (Spring 2.0) and then inject that bean into your prototype or even into a singleton bean that would have all your DAO and other dependencies. Though for the latter don't forget to wrap bean into session-aware proxy, so singleton bean will deal with the right instance.
If you don't want to use session-scoped beans then it is still a good idea to extract state into a separate class and only store that class into the session. Otherwise you'll have to figure out all transient fields for DSO (all DAO and such is not clusterable, since it has links to local resources or databases) and also restore them when object is pulled out of the session.
regards,
Eugene
|
|
|
06/26/2007 01:31:59
|
aldarana
neo
Joined: 06/21/2007 09:02:34
Messages: 8
Offline
|
Thanks,
I didn't use spring session scope, but by refactoring I can do that.
The application is in production, so I can do that in a test enviroment. there are some issues for a transactional bean in session scope?
|
|
|
|