users@glassfish.java.net

Stateful session bean clustering

From: Zlatko Josic <zlatko.josic_at_gmail.com>
Date: Thu, 14 Jul 2011 22:12:52 +0200

Hi,

I have question about stateful session beans clustering. GlassFish server
uses checkpoint method to replicate bean state to replica node. Suppose we
have two nodes. Node A and node b. Node B is replica for node A.

Now suppose we have stateful session bean TestBean with method
increment.Bean uses a local transaction. Bean has field named counter of
long type and initial value is 1. Calling increment method of bean
increments field counter by 1 and write new value to a database.

What will happend in the case when the server A goes down immediately after
commit transaction (node commits transactino successfuly but has not
replicate bean state to replica node) ? Client's ejb proxy will detected
the instance A goes down and will redirect call to node B where counter
value of Bean A is less then the value in the database. Who will synchronize
Test bean state with the value from database?

Thanks

Zlaja


Thanks
Zlaja