I'm forwarding this message from Werner in an attempt to get it to
the list. Evidently the Intalio mail server is filtering for profanity
(how humorous!) and it won't let Werner post this message.

==================BEGIN FORWARDED MESSAGE==================
>From: "Werner Guttmann" <[EMAIL PROTECTED]>
>To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>Date: Wed, 25 Jun 2003 11:18:13 +0200
>Priority: Normal
>X-Mailer: PMMail 2000 Standard (2.20.2661) For Windows 2000 (5.0.2195)
>MIME-Version: 1.0
>Content-Type: multipart/alternative; boundary="_=_=_=IMA.BOUNDARY.HTML_1063496=_=_=_"
>Subject: Re: [castor-dev] CastorJDO + JBoss3.2.1 + Transaction  Management
>

Hi,

On Wed, 25 Jun 2003 01:10:01 -0400, tek1 wrote:

>At 21:22 03/06/24 +0000, you wrote:
>>This one time, at band camp, tek1 said:
>>
>>t>I'm using CastorJDO with my J2EE application to obtain the JDO reference
>>t>from JNDI. Everything is working fine, except for the transaction
>>t>management. When an exception occurs, the operations performed by Castor
>>t>are not rolled back, even though the below is specified in the CastorJDO 
>>MBean:
>>t>
>>t>_jdo.setTransactionManager("java:/TransactionManager");
>>
>>This is perplexing because the DatabaseImpl.rollback() method calls
>>TransactionContext.rollback() which should rollback anything in Castor's
>>transactional context. What types of results are you seeing? Please
>>explain what's happening and we'll see if we can work through it or I'll
>>build a simple test case for it.
>>
>>Bruce
>
>
>Hi Bruce.
>
>Thanks for your reply.
>
>Basically, I have a Stateless Session Bean ("A") with methods a() and b():
>
>
>A
>===
>public void a() <-- called by web client
>protected void b(Database db)
>
>
>1. a() obtains the JDO instance from JNDI, and from the JDO instance, 
>obtains a Database instance.
>2. In performing the business logic, a() makes a call to b(), in which a() 
>passes the Database instance to b().
>3. b() performs does a db.load(class,id) on an object, and changes the 
>value of one of the object's attributes using setXXX().
>4. b() returns a value (that it computed) to a().
>5. At some point in the remainder of a()'s execution, an exception occurs.

What are you doig with this exception ? If you are planning to use container-managed 
transactions (and that's how I 
understand your use case), make sure that the right kind of exception is propagated up 
the exceution chain. If you 
simply catch your application exception, log an error but prevent the exception from 
bubbling up, how should the 
container know that it should rollback your transaction ? I migth be completely wrong 
with this question, but it seems 
worth asking at least.

>6. The changes made to the object in b() are not being rolledback. When I 
>check the database, the value has been changed/committed, when it should 
>not have been... :(
>
>Thinking that the cause may have been because I did not set a()'s 
>transaction attributes in ejb-jar.xml, I then added the "Required" 
>transaction attribute for a().
Looking at this, I was just about to ask whether you specified in the deployment 
descriptor of your web app that 
(global) transactions are required when invoking methods of your EJBs. Having said 
that, it might be worth to specify 
such attribute for b() as well. Please make sure that you use a different transaction 
type (whose name I simply cannot 
remember right now), i.e. one where an existing transaction is usef if available, 
otherwise a new one will be started.

Werner

However, after restarting JBoss and 
>re-running my application, the result was the same. :(
>
>My environment is:
>-J2SE-1.4.1_03 (Sun)
>-JBoss-3.2.1
>-Castor-0.9.4.3
>-Postgresql-7.3.2
>-pg73jdbc3.jar
>
>
>Any suggestions are greatly appreciated...
>
>----------------------------------------------------------- 
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>






===================END FORWARDED MESSAGE===================



--_=_=_=IMA.BOUNDARY.HTML_5388872=_=_=_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<HTML>


<FONT FACE="MS Shell Dlg" DEFAULT="FACE"><FONT SIZE="1" POINTSIZE="8" 
DEFAULT="SIZE">HI,<BR>

<BR>

any idea why this email might be failing your content filter policies ? I mean, here's 
the reply I get from the mailing list 
manager after posting this technical reply to castor-dev.<BR>

<BR>

--- include ---<BR>

<BR>

Trend SMEX Content Filter has detected sensitive content.<BR>

<BR>

Place = [EMAIL PROTECTED]; ; ; [EMAIL PROTECTED]<BR>

Sender = Werner Guttmann<BR>

Subject = Re: [castor-dev] CastorJDO + JBoss3.2.1 + Transaction  Management<BR>

Delivery Time = June 25, 2003 (Wednesday) 02:24:07<BR>

Policy = Dirty Words<BR>

Action on this mail = Delete message<BR>

<BR>

Warning message from administrator:<BR>

Sender, Content filter has detected a sensitive e-mail.<BR>

<BR>

--- include end ---<BR>

<BR>

Regards<BR>

Werner<BR>

<BR>

==================BEGIN FORWARDED MESSAGE==================<BR>

&gt;From: "Werner Guttmann" &lt;[EMAIL PROTECTED]&gt;<BR>

&gt;To: "[EMAIL PROTECTED]" &lt;[EMAIL PROTECTED]&gt;<BR>

&gt;Date: Wed, 25 Jun 2003 11:18:13 +0200<BR>

&gt;Priority: Normal<BR>

&gt;X-Mailer: PMMail 2000 Standard (2.20.2661) For Windows 2000 (5.0.2195)<BR>

&gt;MIME-Version: 1.0<BR>

&gt;Content-Type: multipart/alternative; 
boundary="_=_=_=IMA.BOUNDARY.HTML_1063496=_=_=_"<BR>

&gt;Subject: Re: [castor-dev] CastorJDO + JBoss3.2.1 + Transaction  Management<BR>

&gt;<BR>

<BR>

Hi,<BR>

<BR>

On Wed, 25 Jun 2003 01:10:01 -0400, tek1 wrote:<BR>

<BR>

&gt;At 21:22 03/06/24 +0000, you wrote:<BR>

&gt;&gt;This one time, at band camp, tek1 said:<BR>

&gt;&gt;<BR>

&gt;&gt;t&gt;I'm using CastorJDO with my J2EE application to obtain the JDO 
reference<BR>

&gt;&gt;t&gt;from JNDI. Everything is working fine, except for the transaction<BR>

&gt;&gt;t&gt;management. When an exception occurs, the operations performed by 
Castor<BR>

&gt;&gt;t&gt;are not rolled back, even though the below is specified in the CastorJDO 
<BR>

&gt;&gt;MBean:<BR>

&gt;&gt;t&gt;<BR>

&gt;&gt;t&gt;_jdo.setTransactionManager("java:/TransactionManager");<BR>

&gt;&gt;<BR>

&gt;&gt;This is perplexing because the DatabaseImpl.rollback() method calls<BR>

&gt;&gt;TransactionContext.rollback() which should rollback anything in Castor's<BR>

&gt;&gt;transactional context. What types of results are you seeing? Please<BR>

&gt;&gt;explain what's happening and we'll see if we can work through it or I'll<BR>

&gt;&gt;build a simple test case for it.<BR>

&gt;&gt;<BR>

&gt;&gt;Bruce<BR>

&gt;<BR>

&gt;<BR>

&gt;Hi Bruce.<BR>

&gt;<BR>

&gt;Thanks for your reply.<BR>

&gt;<BR>

&gt;Basically, I have a Stateless Session Bean ("A") with methods a() and b():<BR>

&gt;<BR>

&gt;<BR>

&gt;A<BR>

&gt;===<BR>

&gt;public void a() &lt;-- called by web client<BR>

&gt;protected void b(Database db)<BR>

&gt;<BR>

&gt;<BR>

&gt;1. a() obtains the JDO instance from JNDI, and from the JDO instance, <BR>

&gt;obtains a Database instance.<BR>

&gt;2. In performing the business logic, a() makes a call to b(), in which a() <BR>

&gt;passes the Database instance to b().<BR>

&gt;3. b() performs does a db.load(class,id) on an object, and changes the <BR>

&gt;value of one of the object's attributes using setXXX().<BR>

&gt;4. b() returns a value (that it computed) to a().<BR>

&gt;5. At some point in the remainder of a()'s execution, an exception occurs.<BR>

<BR>

What are you doig with this exception ? If you are planning to use container-managed 
transactions (and that's how I 
<BR>

understand your use case), make sure that the right kind of exception is propagated up 
the exceution chain. If you 
<BR>

simply catch your application exception, log an error but prevent the exception from 
bubbling up, how should the 
<BR>

container know that it should rollback your transaction ? I migth be completely wrong 
with this question, but it seems 
<BR>

worth asking at least.<BR>

<BR>

&gt;6. The changes made to the object in b() are not being rolledback. When I <BR>

&gt;check the database, the value has been changed/committed, when it should <BR>

&gt;not have been... :(<BR>

&gt;<BR>

&gt;Thinking that the cause may have been because I did not set a()'s <BR>

&gt;transaction attributes in ejb-jar.xml, I then added the "Required" <BR>

&gt;transaction attribute for a().<BR>

Looking at this, I was just about to ask whether you specified in the deployment 
descriptor of your web app that 
<BR>

(global) transactions are required when invoking methods of your EJBs. Having said 
that, it might be worth to specify 
<BR>

such attribute for b() as well. Please make sure that you use a different transaction 
type (whose name I simply cannot 
<BR>

remember right now), i.e. one where an existing transaction is usef if available, 
otherwise a new one will be started.
<BR>

<BR>

Werner<BR>

<BR>

However, after restarting JBoss and <BR>

&gt;re-running my application, the result was the same. :(<BR>

&gt;<BR>

&gt;My environment is:<BR>

&gt;-J2SE-1.4.1_03 (Sun)<BR>

&gt;-JBoss-3.2.1<BR>

&gt;-Castor-0.9.4.3<BR>

&gt;-Postgresql-7.3.2<BR>

&gt;-pg73jdbc3.jar<BR>

&gt;<BR>

&gt;<BR>

&gt;Any suggestions are greatly appreciated...<BR>

&gt;<BR>

&gt;----------------------------------------------------------- <BR>

&gt;If you wish to unsubscribe from this mailing, send mail to<BR>

&gt;<FONT COLOR=0000ff><U>[EMAIL PROTECTED]<FONT COLOR=000000 DEFAULT="COLOR"></U> 
with a 
subject of:<BR>

&gt; unsubscribe castor-dev<BR>

&gt;<BR>

<BR>

<BR>

<BR>

<BR>

<BR>

<BR>

===================END FORWARDED MESSAGE===================<BR>

<BR>


</HTML>


--_=_=_=IMA.BOUNDARY.HTML_5388872=_=_=_--



===================END FORWARDED MESSAGE===================

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to