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.

EJB return Java DTO Class

2 posts in EJB Client Last posting was on 2004-05-13 21:37:29.0Z
Nicol=?ISO-8859-1?B?4XM=?= Luzzi Posted on 2004-04-23 14:37:42.0Z
Sender: 77ab.40890ecc.1804289383@sybase.com
From: Nicol=?ISO-8859-1?B?4XM=?= Luzzi
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: EJB return Java DTO Class
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <40892a31.796a.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 23 Apr 2004 07:37:37 -0700, 10.22.241.42
Lines: 82
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Apr 2004 07:37:39 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Apr 2004 07:37:42 -0700
X-Trace: forums-1-dub 1082731062 10.22.108.75 (23 Apr 2004 07:37:42 -0700)
X-Original-Trace: 23 Apr 2004 07:37:42 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:276
Article PK: 424458

I'm receiving the following message:
"PBXRuntimeError raised: Error calling method of a PBNI
object"

It raises when calling the "buscarpornombre" method. More
acurate I can say that the error is when the method returns,
because it take a few seconds to raise, is not instantly.

I think the cause could be the Array of Dto object, but I'm
not sure... thats why i'm writing here.

I will apreciate any kind of help.

A few notes:
The "cliente" class is the remote interface of session
facade class.
The method "buscarpornombre" just call a finder at the CMP
enterprise bean that this facade represents.
All this functionality has been tested manually and works
fine.

################################################################
################################################################
----> Java Code: <----
################################################################
################################################################
/*
The ClienteDto (it means customer Dto)
*/
public class ClienteDto implements Serializable {
private String iDCliente;
private String nombre;


public String getIDCliente() {
return iDCliente;
}
public void setIDCliente(String iDCliente) {
this.iDCliente = iDCliente;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
}

################################################################
################################################################
----> PowerBuilder Code: <----
################################################################
################################################################

/*
I have a previusly created JVM instance and a EJBConnection
instance too.
*/
//This is my EJB Home interface proxy
clientehome miClienteHome

//This is my EJB Remote interface proxy
cliente miCliente

//This is my Data Transfer Object (DTO) interface proxy
clientedto miClienteDTO[]

clienteHome = gEJBConn.lookup("ClienteHome",
"ClienteMERP", "test.ejb.cliente.ClienteHome")
miCliente = clienteHome.create()

/*
The execution of the method at the remote interface that
find a customer by name, and return an array of DTO objects
*/
miClienteDTO[] = miCliente.buscarpornombre("%Nicolas%")

################################################################
################################################################

Thanks
Nicolás Luzzi


Ramés Rodríguez Posted on 2004-05-13 21:37:29.0Z
From: "Ramés Rodríguez" <ramesrv@yahoo.com.mx>
Newsgroups: sybase.public.powerbuilder.ejbclient
Organization: 200.33.20.92
References: <40892a31.796a.1681692777@sybase.com>
X-Newsreader: AspNNTP 1.50 (Takeshi Eto)
Subject: Re: EJB return Java DTO Class
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 64.79.161.46
X-Original-NNTP-Posting-Host: 64.79.161.46
Message-ID: <40a3ea99$1@forums-1-dub>
Date: 13 May 2004 14:37:29 -0700
X-Trace: forums-1-dub 1084484249 64.79.161.46 (13 May 2004 14:37:29 -0700)
X-Original-Trace: 13 May 2004 14:37:29 -0700, 64.79.161.46
Lines: 96
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:278
Article PK: 424459

On 23 Apr 2004 07:37:42 -0700,
in sybase.public.powerbuilder.ejbclient

<NicolásLuzzi> wrote:
>I'm receiving the following message:
>"PBXRuntimeError raised: Error calling method of a PBNI
>object"
>
>It raises when calling the "buscarpornombre" method. More
>acurate I can say that the error is when the method returns,
>because it take a few seconds to raise, is not instantly.
>
>I think the cause could be the Array of Dto object, but I'm
>not sure... thats why i'm writing here.
>
>I will apreciate any kind of help.
>
>A few notes:
>The "cliente" class is the remote interface of session
>facade class.
>The method "buscarpornombre" just call a finder at the CMP
>enterprise bean that this facade represents.
>All this functionality has been tested manually and works
>fine.
>
>################################################################
>################################################################
>----> Java Code: <----
>################################################################
>################################################################
>/*
>The ClienteDto (it means customer Dto)
>*/
>public class ClienteDto implements Serializable {
> private String iDCliente;
> private String nombre;
>
>
> public String getIDCliente() {
> return iDCliente;
> }
> public void setIDCliente(String iDCliente) {
> this.iDCliente = iDCliente;
> }
> public String getNombre() {
> return nombre;
> }
> public void setNombre(String nombre) {
> this.nombre = nombre;
> }
>}
>
>################################################################
>################################################################
>----> PowerBuilder Code: <----
>################################################################
>################################################################
>
>/*
>I have a previusly created JVM instance and a EJBConnection
>instance too.
>*/
>//This is my EJB Home interface proxy
>clientehome miClienteHome
>
>//This is my EJB Remote interface proxy
>cliente miCliente
>
>//This is my Data Transfer Object (DTO) interface proxy
>clientedto miClienteDTO[]
>
>clienteHome = gEJBConn.lookup("ClienteHome",
>"ClienteMERP", "test.ejb.cliente.ClienteHome")
>miCliente = clienteHome.create()
>
>/*
>The execution of the method at the remote interface that
>find a customer by name, and return an array of DTO objects
>*/
>miClienteDTO[] = miCliente.buscarpornombre("%Nicolas%")
>
>################################################################
>################################################################
>
>Thanks
>Nicolás Luzzi

Por lo visto en tu mensaje, imagino que eres Latino. Por tanto te contestare en
Español, sobre todo porque mi ingles no es del todo bueno.

Por lo que puedo ver, devuelves los DTO's en forma de arreglos. Mi solución es
devolverlos como una colección de objetos, es decir, a través de un
java.util.Collection
>miClienteDTO[] = miCliente.buscarpornombre("%Nicolas%")

Ramés Rodríguez