[JBoss Seam] - Re: Does anyone use @Rollback?
by paulie!
"gavin.king(a)jboss.com" wrote : This is NOT the right way to implement atomic conversations! You are supposed to either do your work outside a transaction, or use @Begin(flushMode=FlushMode.MANUAL).
|
Wow I got an exclamation mark! AND capitals! We have been using Seam for a year now and have good chunk of code in production etc. So when Seam 1.0.1GA came out we decided to only upgrade when stable releases come out. Becaue of this it doesn't look like we can use the flushmode (although it is perfect for this) at the time I searched the doco and javadoc and couldn't come up with anything. So I tried using @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED), which didn't change a thing, the lists were still getting persisted. At that point I had too much other work to do so I used the above Hack (and hack it certainly is).
So this leads me to asking if I can get an example of how to implement the "atomic conversation" pattern with Seam 1.0.1GA. If it is indeed to use TransactionAttribute then obviously I missed something and need to revisit my code.
Bit of a thread hijack I know, but no-one seems to be posting here.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983361#3983361
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983361
19Â years, 6Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: JBoss 3.2.5/MySQL 4.0 ejbCreate throws NullPointer excep
by pintovc
Here is my ejb-jar.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar >
<![CDATA[No Description.]]>
<display-name>Generated by XDoclet</display-name>
<enterprise-beans>
<!-- Session Beans -->
<![CDATA[EJB that computes Fibonacci Suite]]>
<display-name>Fibo EJB</display-name>
<ejb-name>Fibo</ejb-name>
wonomi.identityManagement.interfaces.FiboHome
wonomi.identityManagement.interfaces.Fibo
<ejb-class>wonomi.identityManagement.ejb.FiboBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the markup for those beans.
-->
<!-- Entity Beans -->
<![CDATA[]]>
<ejb-name>UserProfile</ejb-name>
<local-home>wonomi.identityManagement.interfaces.UserProfileLocalHome</local-home>
wonomi.identityManagement.interfaces.UserProfileLocal
<ejb-class>wonomi.identityManagement.ejb.UserProfileBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
true
<cmp-version>2.x</cmp-version>
<abstract-schema-name>UserProfile</abstract-schema-name>
<cmp-field >
<![CDATA[]]>
<field-name>id</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>userName</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>password</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o]]></ejb-ql>
<query-method>
<method-name>findByID</method-name>
<method-params>
<method-param>java.lang.Integer</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o where o.id = (?1)]]></ejb-ql>
<query-method>
<method-name>findByUserName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o where o.userName = (?1)]]></ejb-ql>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o]]></ejb-ql>
<!-- Write a file named ejb-finders-UserProfileBean.xml if you want to define extra finders. -->
<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the markup for those beans.
-->
<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
</enterprise-beans>
<!-- Relationships -->
<!-- Assembly Descriptor -->
<assembly-descriptor >
<!--
To add additional assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.
-->
<!-- finder permissions -->
<!-- finder permissions -->
<!-- transactions -->
<!-- finder transactions -->
</assembly-descriptor>
</ejb-jar>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983353#3983353
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983353
19Â years, 6Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: JBoss 3.2.5 MySQL 4.0 finder Method gives a Finder Excep
by pintovc
Here is the ejb-jar.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar >
<![CDATA[No Description.]]>
<display-name>Generated by XDoclet</display-name>
<enterprise-beans>
<!-- Session Beans -->
<![CDATA[EJB that computes Fibonacci Suite]]>
<display-name>Fibo EJB</display-name>
<ejb-name>Fibo</ejb-name>
wonomi.identityManagement.interfaces.FiboHome
wonomi.identityManagement.interfaces.Fibo
<ejb-class>wonomi.identityManagement.ejb.FiboBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the markup for those beans.
-->
<!-- Entity Beans -->
<![CDATA[]]>
<ejb-name>UserProfile</ejb-name>
<local-home>wonomi.identityManagement.interfaces.UserProfileLocalHome</local-home>
wonomi.identityManagement.interfaces.UserProfileLocal
<ejb-class>wonomi.identityManagement.ejb.UserProfileBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
true
<cmp-version>2.x</cmp-version>
<abstract-schema-name>UserProfile</abstract-schema-name>
<cmp-field >
<![CDATA[]]>
<field-name>id</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>userName</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>password</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o]]></ejb-ql>
<query-method>
<method-name>findByID</method-name>
<method-params>
<method-param>java.lang.Integer</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o where o.id = (?1)]]></ejb-ql>
<query-method>
<method-name>findByUserName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o where o.userName = (?1)]]></ejb-ql>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql><![CDATA[select object(o) from UserProfile o]]></ejb-ql>
<!-- Write a file named ejb-finders-UserProfileBean.xml if you want to define extra finders. -->
<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the markup for those beans.
-->
<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
</enterprise-beans>
<!-- Relationships -->
<!-- Assembly Descriptor -->
<assembly-descriptor >
<!--
To add additional assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.
-->
<!-- finder permissions -->
<!-- finder permissions -->
<!-- transactions -->
<!-- finder transactions -->
</assembly-descriptor>
</ejb-jar>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983351#3983351
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983351
19Â years, 6Â months