I am still baffled by the issue I raised in my prior post, but I have been able
to get TellerBean to support funds transfer through use of TxController.
For the record, it's easy -- here are the steps:
1) In dd/ws/ejb-jar.xml, in the element for TellerBean, add
| <ejb-ref>
| <ejb-ref-name>ejb/tx</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>com.sun.ebank.ejb.tx.TxControllerHome</home>
| <remote>com.sun.ebank.ejb.tx.TxController</remote>
| </ejb-ref>
|
2) In dd/ws/jboss.xml, in the element for TellerBean, add
| <ejb-ref>
| <ejb-ref-name>ejb/tx</ejb-ref-name>
| <jndi-name>ebankTxController</jndi-name>
| </ejb-ref>
|
3) Add to TellerEndpoint.java:
| public BigDecimal transfer(String fromAccountID, String toAccountID,
| BigDecimal amountToTransfer)
| throws RemoteException;
|
4) In TellerBean.java, instantiate a TxController proxy by:
| InitialContext ctx = new InitialContext();
| TxControllerHome txHome = (TxControllerHome)
| ctx.lookup("java:comp/env/ejb/tx");
|
| TxController txController = txHome.create();
|
5) Within TellerBean.transfer(String,String,BigDecimal), invoke whatever method
of TxController you want for your "business logic" -- in my case, it was
TxController.transferFunds(BigDecimal,String,String,String). It works great,
including transaction logging, etc., as verified by the bank/main web app.
Back to your regularly scheduled hacking,
--Gary
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3908564#3908564
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3908564
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user