Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to handle empty java array?

2 posts in EJB Client Last posting was on 2004-03-01 10:13:38.0Z
bede Posted on 2004-02-26 14:35:46.0Z
From: "bede" <bede@nospam.sofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: How to handle empty java array?
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Message-ID: <403e0456@forums-2-dub>
X-Original-Trace: 26 Feb 2004 06:36:06 -0800, uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 26 Feb 2004 06:35:03 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 26 Feb 2004 06:35:46 -0800
X-Trace: forums-1-dub 1077806146 10.22.108.75 (26 Feb 2004 06:35:46 -0800)
X-Original-Trace: 26 Feb 2004 06:35:46 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:249
Article PK: 424432

Hi all,

Using PB9.0.1 (#7096) and EAServer 4.1.3.

I'm getting an "Error calling method of a PBNI object" when trying to access
an empty array, coming from the java-EJB.

My intention is using that array as an argument of a function call, but as
soon as that array is addressed (as the argument) , the error happens. The
nasty thing is that you can't even check (eg. isNull() or isValid()) whether
that object is ok or not, since you'd be addressing it again, resulting in
the same.

When the array has 1 or more items then this works fine!

The only thing to prevent PB from crashing is putting it in a Try Catch, but
this way you can't even be guaranteed if the reason for the
catch(runtimeerror) is always that same empty array, so that's no good.

any experiences? thoughts? is this another bug?

thanks,

Ben

PS: in the example; i_calendarSessPar is the parameter, returned by the java
EJB, the ...thecalendarentries.data is that array
This is not the only case; I've had the same experience with all other empty
arrays!

Try

lnv_javarsv_CalendarEntry.of_setdata(i_calendarSessPar.thecalendar.thecalend
arentries.thecalendarentries.data, 1)
// Visualize
ids_theCalendarEntries.shareData(Parent.dw_entries)

catch (runtimeerror rt2)
messagebox("", rt2.getMessage())
catch ( Exception e3 )
messagebox("", e3.getMessage())
return -1
End Try


bede Posted on 2004-03-01 10:13:38.0Z
From: "bede" <bede@nospam.sofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <403e0456@forums-2-dub>
Subject: Re: How to handle empty java array?
Lines: 74
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Message-ID: <40430cd2$1@forums-1-dub>
Date: 1 Mar 2004 02:13:38 -0800
X-Trace: forums-1-dub 1078136018 194.7.38.226 (1 Mar 2004 02:13:38 -0800)
X-Original-Trace: 1 Mar 2004 02:13:38 -0800, uu194-7-38-226.unknown.uunet.be
X-Authenticated-User: pbtenbeta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:250
Article PK: 424434

FYI, a case (# 20340238) has been opened regarding this.

Another strange thing: in the PB debugger, parts of the EJB data structures
are listed as being null, but when you assign them to smaller parts they do
contain values which are not null.

example:

lnv_EJBPar.theElements[1].name = "donald"
lnv_EJBPar.theElements[1].type = "duck"

the debugger would show theElements[] as an array with 1 item, but when you
click to open the item you see all itemvalues = null

It almost seems that pbejbclient90.dll is missing some coding for nulls and
arrays..

"bede" <bede@nospam.sofico.be> wrote in message
news:403e0456@forums-2-dub...
> Hi all,
>
> Using PB9.0.1 (#7096) and EAServer 4.1.3.
>
> I'm getting an "Error calling method of a PBNI object" when trying to
access
> an empty array, coming from the java-EJB.
>
> My intention is using that array as an argument of a function call, but as
> soon as that array is addressed (as the argument) , the error happens. The
> nasty thing is that you can't even check (eg. isNull() or isValid())
whether
> that object is ok or not, since you'd be addressing it again, resulting in
> the same.
>
> When the array has 1 or more items then this works fine!
>
> The only thing to prevent PB from crashing is putting it in a Try Catch,
but
> this way you can't even be guaranteed if the reason for the
> catch(runtimeerror) is always that same empty array, so that's no good.
>
> any experiences? thoughts? is this another bug?
>
> thanks,
>
> Ben
>
> PS: in the example; i_calendarSessPar is the parameter, returned by the
java
> EJB, the ...thecalendarentries.data is that array
> This is not the only case; I've had the same experience with all other
empty
> arrays!
>
> Try
>
>
lnv_javarsv_CalendarEntry.of_setdata(i_calendarSessPar.thecalendar.thecalend
> arentries.thecalendarentries.data, 1)
> // Visualize
> ids_theCalendarEntries.shareData(Parent.dw_entries)
>
> catch (runtimeerror rt2)
> messagebox("", rt2.getMessage())
> catch ( Exception e3 )
> messagebox("", e3.getMessage())
> return -1
> End Try
>
>