Hi Subbu and Alex,

Thanks for taking time looking into my problem.

I haven't found anymore info on that yet.  What is bugging me is that if you 
throw inside a TTS you're automatically rollbacking the transaction no matter 
if you could catch the error inside the TTS or not.  We happen to discover this 
when using a static method I made sometime ago that calls other method that 
thrown exception and catch them.  Calling this without TTS you don't even know 
there's throw and catch in there (you don't need to know) and everything works 
fine.  Calling this method in a TTS will result in an aborted transaction.  
From the developer point of view that only needs to know parameters and return 
value (blackbox), the changing behaviour when in TTS or not is a bit weird.

I guess I'll make it a new rule here to only use "throw" when you want to 
rollback a transaction.

If anyone has more infos/tips/clues, I'd be more then interested to here them.

Have a nice day!

Steeve... 


-----Message d'origine-----
De : Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] De la 
part de Subrahmanyam, Mamidi
Envoyé : 13 février 2006 18:55
À : Axapta-Knowledge-Village@yahoogroups.com
Objet : Re: [Axapta-Knowledge-Village] Re: Throw inside TTS catch outside TTS

Yo Steve,
  I commneted the ttsbegin part.......Now I could hit 'Catch inside TTS'
   
   try {
       // ttsbegin;
          try {
       
            throw Exception::Error;
        } catch (Exception::Error) {
            info("Catch inside TTS");
        }
       // ttscommit;
    } catch (Exception::Error) {
        info("Catch outside TTS");
    }

so something with tts commands..
   
  did you find out any thing Steve on this???.
   
  As per theory, it should hit the immediate catch level till it finds the 
return macth...
   
  subbu
  
"Subrahmanyam, Mamidi" <[EMAIL PROTECTED]> wrote:
  Hi Alex,
   
  The concept should be as follows as its the same for C++ or JAVA. I am pretty 
sure it should be the case for all object oriented labgugaes.....
   
  Whenever a throw occurs in a nested try catch blocks , depending upon the 
return type, the Immediate catch should be hit.....Since the return  type here 
is error and the immediate catch block  should be hit.......
   
  ..or 
  How can we hit the inner exception?...
   
  interesting..let me dig into more....
   
   
   
  

Alexander <[EMAIL PROTECTED]> wrote:
  Hi Steeve,

This is normal Axapta behavior. Here is Developer's giude quote:

"If an error is thrown and the first try block does not catch the 
exception, the exception is propagated to the next try block, and so 
forth. The outermost level is the "normal" handling of errors in 
X++."

Your exception was caught by FIRST try operator.

Alex...


--- In Axapta-Knowledge-Village@yahoogroups.com, "Steeve Gilbert" 
<[EMAIL PROTECTED]> wrote:
>
> Running this :
> 
>     try {
>         ttsbegin;
>         try {
>             throw Exception::Error;
>         } catch (Exception::Error) {
>             info("Catch inside TTS");
>         }
>         ttscommit;
>     } catch (Exception::Error) {
>         info("Catch outside TTS");
>     }
> 
> Shows "Catch oustide TTS".  Is it intended that the catch inside 
the TTS
> doesn't catch the exception thrown?
> 
> 
> Steeve...
>







Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends. 



  SPONSORED LINKS 
        Business finance course   Business to business finance   Small business 
finance     Business finance consultant   Business finance magazine   Business 
finance schools 
    
---------------------------------
  YAHOO! GROUPS LINKS 

    
    Visit your group "Axapta-Knowledge-Village" on the web.
    
    To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
    
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

    
---------------------------------
  

  


            
---------------------------------
Yahoo! Mail
Use Photomail to share photos without annoying attachments.

[Non-text portions of this message have been removed]



Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends. 



  SPONSORED LINKS 
        Business finance course   Business to business finance   Small business 
finance     Business finance consultant   Business finance magazine   Business 
finance schools 
    
---------------------------------
  YAHOO! GROUPS LINKS 

    
    Visit your group "Axapta-Knowledge-Village" on the web.
    
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
    
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

    
---------------------------------
  

  


                
---------------------------------
 
 What are the most popular cars? Find out at Yahoo! Autos 

[Non-text portions of this message have been removed]



Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends. 
Yahoo! Groups Links



 







Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Axapta-Knowledge-Village/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to