I'm using clustered environment as under:
App Server : Weblogic 5.1 SP8
WebServer : iPlanet 4.1
Database : Oracle
I'm using Weblogic's "Recommended 2-Tier Cluster Architecture" i.e JSP's, Servlets & EJB's(Session & Entity) all reside on a cluster of weblogic servers. http://www.weblogic.com/docs51/cluster/planning.html#1040272
I'm testing "with-in method level(session bean) failover" in case of Network Failure/Machine Shutdown.
From Servlet am calling a session bean method
postOrder(xxx) method is doing something like this :
create a entity bean(row created with Primary Key),
call setDO(xxx) method on entity bean,
Since the "trans-attribute" has been set as "Required" in Session Bean, so transaction starts as soon as postOrder(xxx) method is called by servlet. And since the "trans-attribute" of Entity Bean is also set as "Required" so Entity Beans' methods which are called in postOrder(xxx) join the same transaction.
Element "trans-timeout-seconds" has been set as 20 seconds in Session Beans'
"weblogic-ejb-jar.xml "so that this transaction rolls-back if not commited between 20 seconds.
Now our with-in method(session bean) failure occurs between create(PK element) and setDO(xxx). That is our failure occurs after creating row in DB (but only PK is inserted through create(PK element)) but before setting other columns in DB.
I did this by inserting System.in.read() between these two method calls & I take network cord out when weblogic server waits for some input.
Lock is released from DB after "trans-timeout-seconds" ie 20 seconds. This has been confirmed by simultaneously trying to insert a row in DB with same Primary Key from a completely different application using direct JDBC commands. Firstly it keeps on waiting but inserts a row after transaction which is started by Weblogic times out.
Now since the servlet has been marked as Idempotent, so servlet is called again on a different weblogic server instance. Note that previous transaction has already been timed-out. But when create(PK element) method is called from postOrder(xxx) it keeps on waiting till this new transaction timed out.
I didn't start any UserTransaction in the servlet because we are calling only one Session Bean method.
Why this weird behaviour is occuring even though lock on DB has been released which is confirmed as I said above?
Any help regarding this would be appreciated.
Thanks and Regards,