tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanimir Komitov <stani...@devbg.piranko.com>
Subject Re: How to exclude some classes to being serialized in sharing session with clustered tomcats?
Date Wed, 11 Feb 2009 15:10:42 GMT
Ok, I`m using jsf and have managed beans with session scope and
properties other managed beans. Most of them have application scoped
beans references as properties, which makes connection to DB...and...
these fields are defined as transient to prevent serialization.

eg.
class TestBean implements Serializable {
        private String xyz;
        private transient MyService service;
        :
}

in faces-config.xml
<managed-bean>
        <managed-bean-name>testBean</managed-bean-name>
  <managed-bean-class>aaa.bbb.ccc.ddd.eee.TestBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
		<property-name>service</property-name>
		<property-class>aaa.bbb.ccc.ddd.MyService</property-class>
		<value>#{service}</value>
	</managed-property>
</managed-bean>

but when the application is restarted, the session scoped beans are
serialized on stop and restored on requesting the same session after
start, but when the class is deserialized, transient fields are null.
Is there any "easy" way to restore transient fields references from the
new session or at deserialization to get only available fields from the
object, not the whole object? Maybe a wrapper of StandardManager!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message