[jboss-user] [JBoss Cache: Core Edition] - Serialize/deserialize Stateful bean

Pop Octavian do-not-reply at jboss.com
Wed Nov 19 09:03:25 EST 2008


Our application uses stateful beans which are configured to be added in a EJB3SFSBClusteredCache cache. 
The EJB3SFSBClusteredCache cache loader is configured to use a DB table.

We want to use the DB as a persistence layer to store all stateful beans and be able to load serialized beans after JBoss restarts. 

We managed to persist stateful beans to DB, but when jboss is stopped the corresponding records (for stateful beans) are deleted from DB.

It is possible to store stateful beans and load them after restart?
If possible, how can I identify a specific bean used before JBoss restart, to continue the operations on the same object?

If someone can give some guidelines or best practices it would be helpful.

The cache loader configuration from ejb3-clustered-sfsbcache-service.xml is as below:

  |  <attribute name="CacheLoaderConfiguration">
  |          <config>
  |                 <passivation>false</passivation> 
  |                 <preload></preload>
  |                 <shared>false</shared>
  |                 <cacheloader>
  |                 <properties>
  |                         cache.jdbc.table.name=jbosscache
  |                         cache.jdbc.table.create=true
  |                         cache.jdbc.table.drop=false
  |                         cache.jdbc.table.primarykey=jbosscache_pk
  |                         cache.jdbc.fqn.column=fqn
  |                         cache.jdbc.fqn.type=varchar(255)
  |                         cache.jdbc.node.column=node
  |                         cache.jdbc.node.type=blob
  |                         cache.jdbc.parent.column=parent
  |                         cache.jdbc.driver=oracle.jdbc.OracleDriver
  |                         cache.jdbc.url=jdbc:oracle:thin:@192.168.3.10:1521:orcl
  |                         cache.jdbc.user=util
  |                         cache.jdbc.password=pass
  |                         cache.jdbc.sql-concat=concat(1,2)
  |                 </properties>
  |                 <class>org.jboss.cache.loader.JDBCCacheLoader</class>
  |                 <async>false</async>
  |                 <fetchPersistentState>true</fetchPersistentState>
  |                 <ignoreModifications>false</ignoreModifications>
  |                 <!--purgeOnStartup>false</purgeOnStartup-->
  |                 </cacheloader>
  |         </config>
  |     </attribute>


Regards. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190491#4190491

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190491



More information about the jboss-user mailing list