WebSphere Portal Server - Sharing connections

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > September 2005 > Sharing connections





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Sharing connections

2005-09-26, 6:04 pm

Hello everyone! How do you enable portlets to share connections to a database? Is it a good practice to have multiple portlets share a connection to a DB, or should they use separate connections.
George Daswani

2005-09-26, 8:50 pm

You need to create a DataSource in the WAS Admin - standard J2EE stuff
(Connection Pool)..

During portlet processing (eq. doView), you retrieve a JDBC connection by
looking up the ConnectionPool via JNDI, then close said connection in the
finally block..

Sharing the exact same database connection (if you made the conn handle a
static variable) will lead you to a deadlock.

<darnley_etienne@bankone.com> wrote in message
news:702927184.1127748600146.JavaMail.wassrvr@ltsgwas007.sby.ibm.com...
> Hello everyone! How do you enable portlets to share connections to a
> database? Is it a good practice to have multiple portlets share a
> connection to a DB, or should they use separate connections.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com