Hi

[EMAIL PROTECTED] wrote:

> Hello everyone,
>
> I'm using ND5, NT4, SP4 with a Sybase database.
>
> In my code, I need to check to be sure that the results I retrieve from my EJB
> actually executed successfully. I am using the following to do that check:
>
> /***** Begin Code Snippet *****/
>
> CSpServerObject _iface =
> (CSpServerObject)CSpider.getDataObject("daoMasterFileSearchBL");
> // Retrieve the bean function we want to use and execute it.
> CSpServerMethod meth = _iface.getServerMethod("getEntityListBL");
> meth.clearAllCachedData();
> meth.setValue("p_iAppID", new CSpInteger(_iAppID));
> meth.execute();
> CSpDBResult resResult =
> (CSpDBResult)((CSpAnyObject)meth.getReturnValue()).get();
>
> if (resResult.getResultStatus().getErrorCode() != CSpDBResultStatus.SUCCESS)

You need to check even for CSpDataObject.END_OF_FETCH (which is 9)
or you can check for
if (CSpDataObject.succeded(resResult))  //which covers both the cases

Satya

>
> {
>      // Do some stuff here to handle the problem...
> }
> else
> {
>      // Proceed normally.
> }
>
> /***** End Code Snippet *****/
>
> The Bean method getEntityListBL() simply performs an executeImmediate on a
> generated SQL statement.
>
> When everything works properly and I get the results I expect back from the
> bean, resResult.getResultStatus().getErrorCode() translates to a value of 9.
>
> However, CSpDBResult.SUCCESS translates to a value of 0. Am I making the wrong
> comparison to determine if the executeImmediate() was successful, or have I
> missed something else here?
>
> Thanks in advance for any insight,
> Beth
>
> -------------------------------------------------------------------------
> Beth Elicia Finn                              Competitive Media Reporting
> Applications Developer                              1385 Enterprise Drive
> [EMAIL PROTECTED]                                      West Chester, PA 19380
> http://www.cmr.com/                                        (610) 430-6404
>
> ________________________________________________________________________
> For help in using, subscribing and unsubscribing to the discussion
> forums please go to: http://www.netdynamics.com/support/visitdevfor.html
>
> For dire need help, email: [EMAIL PROTECTED]

S/MIME Cryptographic Signature

Reply via email to