iam trying to use BMP with jboss 2.4 with sample
so that we can try jboss on our next project.:)
iam doing system.out print the BMP bean as
pls help me......
Context initial = new InitialContext();
Object objref = initial.lookup("SavingsAccountEJB");
SavingsAccountHome home =
(SavingsAccountHome)PortableRemoteObject.narrow(objref,
SavingsAccountHome.class);
BigDecimal zeroAmount = new BigDecimal("0.00");
SavingsAccount duke = home.create("123", "Duke", "Earl", zeroAmount);
duke.credit(new BigDecimal("88.50"));
duke.debit(new BigDecimal("20.25"));
BigDecimal balance = duke.getBalance();
System.out.println("balance = " + balance);
duke.remove();
SavingsAccount joe = home.create("836", "Joe", "Jones", zeroAmount);
joe.credit(new BigDecimal("34.55"));
SavingsAccount jones = home.findByPrimaryKey("836");
jones.debit(new BigDecimal("2.00"));
balance = jones.getBalance();
System.out.println("balance = " + balance);
SavingsAccount pat = home.create("456", "Pat", "Smith", zeroAmount);
pat.credit(new BigDecimal("44.77"));
SavingsAccount john = home.create("730", "John", "Smith", zeroAmount);
john.credit(new BigDecimal("19.54"));
SavingsAccount mary = home.create("268", "Mary", "Smith", zeroAmount);
mary.credit(new BigDecimal("100.07"));
=========my ejb-jar.xml
<container-transaction>
<ejb-name>SavingsAccountEJB</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
====
iam getting first two out then following error comes
[17:13:21,760,Default] balance = 68.25
[17:13:22,030,Default] balance = 32.55
[17:13:28,300,Default] Caught an exception.
[17:13:28,300,Default] java.rmi.ServerException: Exception occurred; nested exception is:
javax.ejb.EJBException: ejbCreate: General error: Lock wait timeout exceeded; Try restarting transaction
[17:13:28,350,Default] javax.ejb.EJBException: ejbCreate: General error: Lock wait timeout exceeded; Try restarting transaction
[17:13:28,350,Default] at org.jboss.docs.savingsaccount.SavingsAccountBean.ejbCreate(SavingsAccountBean.java:91)
[17:13:28,350,Default]