Passing a java.sql.Connection by RMI.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, May 30, 2001 09:39 AM

I have an EJB that serves as connection pool. It has two methods for the clients ejb to request and release a PooledConnection (whose attribute is a java.sql.Connection). These remote methods return and needs an instance of PooledConnection as parameter, respectivelly. When I run the app, it spawns a NotSerializable exception. I've tried to implement Serializable interface on the PooledConnection class (see code), but spawns a CORBA.BAD_PARAM. Any ideas to fix it? Thanks in advance. [here is the code of the serialization] public class GESPooledConnection implements Serializable { private Connection conn = null; private    More>>

I have an EJB that serves as connection pool. It has two methods for the clients ejb to request and release a PooledConnection (whose attribute is a java.sql.Connection). These remote methods return and needs an instance of PooledConnection as parameter, respectivelly. When I run the app, it spawns a NotSerializable exception. I've tried to implement Serializable interface on the PooledConnection class (see code), but spawns a CORBA.BAD_PARAM.



Any ideas to fix it?



Thanks in advance.



[here is the code of the serialization]



public class GESPooledConnection implements Serializable

{

private Connection conn = null;

private boolean is_available;


private void writeObject(java.io.ObjectOutputStream out)

throws IOException {

out.defaultWriteObject();

}



private void readObject(java.io.ObjectInputStream in)

throws IOException, ClassNotFoundException {

System.out.println("[!] readObject()");
in.defaultReadObject();

}



[...]

   <<Less

Re: Passing a java.sql.Connection by RMI.

Posted By:   AlessandroA_Garbagnati  
Posted On:   Wednesday, May 30, 2001 10:35 AM

Hi,

The connection object is not serializable and cannot be passed through RMI.
About | Sitemap | Contact