GeeCON Prague 2014*
The moose likes Web Services and the fly likes connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "connection pooling" Watch "connection pooling" New topic
Author

connection pooling

rik antropov
Greenhorn

Joined: Feb 26, 2007
Posts: 7
I'm running weblogic 9.2, but I did not think this topic is product specific, so I'm posting it here:

I need to write or implement a connection pool to another piece of hardware that I communicate with over ethernet. It's not a database. Does something like this already exist, and if not, does anyone know of any examples of this? Thanks.

rik
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Something that implements the J2EE Connector Architecture (JSR-112)?

Dive into connection pooling with J2EE
Managing Connections with J2EE Connector Architecture

BEA WebLogic Server 9.2 Documentation;
Programming WebLogic Resource Adapters;
Understanding Resource Adapters: J2EE Connector Architecture

The EJB and Other Java EE Technologies forum is the usual venue for discussion of JCA.
rik antropov
Greenhorn

Joined: Feb 26, 2007
Posts: 7
Thanks for the response.
To use the J2EE connector arch, does the other end need to be an EIS?
The piece of hardware that i'm communicating with communicates via tcp/ip , and i just send ascii or binary data to it.
What i am doing currently is each time i need to send it a command, i open up a socket, send the command, get a response and close the socket. This does not scale well, so I'm looking to use a connection pool or something like it.
I'm not even sure something like this exists for non db or EIS stuff.

rik
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
It seems that you should be able to create network sockets inside your ManagedConnection class.

Getting Started with Connectors in Sun Java System Application Server Platform Edition 8.0:

ManagedConnection: A javax.resource.spi.ManagedConnection instance represents a physical connection to an underlying EIS. The creation of a ManagedConnection instance typically results in the allocation of EIS and resource adapter resources (for example, memory and network sockets) for each physical connection. Since these resources can be costly and scarce, an application server pools ManagedConnection instances in a managed environment. This interface is used only internally within the application server; applications do not use this interface.


However examples seem to be hard to come by.

Here javamail is used in a Resource Adapter to access an email server: Creating Resource Adapters with J2EE Connector Architecture 1.5

The source code should be in the sample code of the Sun Java System Application Server PE 8.2.
rik antropov
Greenhorn

Joined: Feb 26, 2007
Posts: 7
Thanks Peer.

I'll take a look at those links.

rik
 
GeeCON Prague 2014
 
subject: connection pooling