My Bean is a BMP entity bean, and I have already set the
<persistence-type>Bean</persistence-type> in ejb-jar.xml.
In my impression, <transaction-type> </transaction-type> is only needed in the
ejb-jar.xml for a Session Bean?
Better if someone could send me a BMP entitybean .jar file with the source code that
really works with transaction
on JBoss+Tomcat. All of us knows, that the poor documentation and examples of JBoss
frustrated us too much.
May any of you do me the favour? Thanks a lot!!!!!!!
Below is my ejb-jar.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
<description>zee120 Bean</description>
<display-name>zee120BeanHome</display-name>
<enterprise-beans>
<entity>
<ejb-name>zee120BeanHome</ejb-name>
<home>com.edward.MSTMT.Entity.zee120.zee120BeanHome</home>
<remote>com.edward.MSTMT.Entity.zee120.zee120</remote>
<ejb-class>com.edward.MSTMT.Entity.zee120.zee120Bean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.edward.MSTMT.Entity.zee120.zee120BeanPK</prim-key-class>
</entity>
</enterprise-beans>
</ejb-jar>
below is the jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<entity>
<ejb-name>zee120BeanHome</ejb-name>
<jndi-name>zee120BeanHome</jndi-name>
</entity>
</enterprise-beans>
</jboss>
Thanks in advance.
Edward
----- Original Message -----
From: Saint-Martin Cecile
To: [EMAIL PROTECTED]
Sent: Wednesday, July 11, 2001 5:28 PM
Subject: RE: [JBoss-user] Urgent, May someone tell me how JBoss realize a Transaction?
Is your entity ben CMP or BMP, i.e. in your ejb-jar.xml file what's your
<transaction-type> </transaction-type> value?
SAINT-MARTIN Cecile
[EMAIL PROTECTED]
-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]De la part de Edward Wang
Envoy�� : mercredi 11 juillet 2001 11:12
�� : JBoss
Objet : [JBoss-user] Urgent, May someone tell me how JBoss realize a Transaction?
Now I am using JBoss+Tomcat 2.22 pack.
I setup a Datasource that connect to SQLServer 7.0 with the JDBC Driver of WebLogic
(BEA Sys, a Type 4 Driver).
And in my Client Class that calls an EJB (Entity), I use the
"javax.transaction.UserTransaction", it seems JBoss
can not find the name in it's Context. Then I use a TxManager class in the following
way:
TxManager tx = null;
try {
tx = org.jboss.tm.TxManager.getInstance();
tx.begin();
zee120Beanhome home = getHome();
zee120BeanPK pk = new zee120BeanPK("001");
zee120 cli = home.findByPK(pk);
cli.remove();
tx.commit();
} catch (Exception e) {
tx.rollback();
}
The record "001" is expected to exist in my DB still if some error occurs, but the
result is it was removed.
How can I use Transaction with JBoss?
Thanks for your help.
$,���f��)��+-$,���X���(��~��zw���i��b��,���y�+���b��?�+-�w��6�ˬz