Returning Oracle errors on retry?

Posts   
 
    
dheinbach
User
Posts: 4
Joined: 19-Nov-2018
# Posted on: 19-Nov-2018 20:01:22   

Good day,

I'm having an issue handing an error propery from LLBLGEN. In instances where it needs to retry per the maximumNumberOfRetries setting.

It returns the appropriate ORMTransientRecoveryFailedException, but what I'm looking for is the inner error which oracle threw to cause the failure.

In Visual Studio, I can see a CapturedException from Oracle:

{"An exception was caught during the execution of an action query: ORA-01653: unable to extend table <table> by 128 in tablespace <schema>\nORA-06512: at line 1\n. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."}

However, I can't find a way to get this error from the exception that LLBLGEN throws, and so cannot access the ORA error programatically.

Is there any way to make LLBLGEN pass these errors onward?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 19-Nov-2018 20:32:27   

Could you give a bit more context? I.e. the version you're using (of llblgen pro) and e.g. you're using a transient error recovery class I presume, one you wrote yourself? the error you got isn't a transient error so the transient error recovery class has to detect that and rethrow it as a normal exception.

Frans Bouma | Lead developer LLBLGen Pro
dheinbach
User
Posts: 4
Joined: 19-Nov-2018
# Posted on: 19-Nov-2018 20:54:19   

This is with LLBLGEN 5.3

You're right, the error I posted was the Oracle exception which Visual Studio is catching. LLBLGen's error is as follows:

An exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMTransientRecoveryFailedException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.dll but was not handled in user code {"Recovery failed: Maximum number of retries of 5 exceeded."}

There is no inner exception. This is thrown by a SaveEntity call to a dataAccessAdapter. VS can see that the error that caused 5 failures was a table space issue, but that isn't returned by LLBLGEN so I can't check for it in my application when I go to handle that exception.

e; To clarify, I know what is causing the oracle issue (I did, on purpose, to test this), my issue is that when Oracle throws the error, all I'm getting back is a generic "max retries exceeded" rather than an error indicating the underlying issue.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Nov-2018 06:59:35   

You wrote a transient error recovery class, Right? Could you show it to us? When errors occur during the execution and they're transient errors, they're still collected within the strategy used. To obtain the exceptions, read the **CollectedExceptions **property of the strategy after the execution of the work, which contains the collected exceptions. These exceptions are the wrapping exceptions, and are of type ORMException. Those are the ones you could examine and see what Oracle error is (in the message or stack trace of the exception).

Also, after a recovery failure, if after the maximum number of attempts or the maximum delay the work still fails, the strategies will report this with an **ORMTransientRecoveryFailedException **exception. It can be used to perform other ways to recover from the errors. It contains all exceptions collected during the execution and retry phase of the strategy. Ref....

David Elizondo | LLBLGen Support Team
dheinbach
User
Posts: 4
Joined: 19-Nov-2018
# Posted on: 20-Nov-2018 16:21:53   

I'm just using a SimpleRetryRecoveryStrategy, will this show the exceptions which are collected?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 20-Nov-2018 19:20:57   

Please check the CollectedExceptions property of the SimpleRetryRecoveryStrategy.

dheinbach
User
Posts: 4
Joined: 19-Nov-2018
# Posted on: 20-Nov-2018 19:36:15   

Awesome! I didn't realize they'd be attached to a different object.

Thanks!