You need to be using connection pools rather than creating a raw JDBC
connection every time you have a database access, this is why you are
running out of concurrent connections. I suspect you are running out
of connections because they are never close()d either. Most
web/application servers provide a connection pool instance, and if
not, there's a Jakarta (commons?) implementation as well.

Also, you cannot store the connection as a private field of an action
as action class instances are shared among the requests coming in. To
avoid headaches, in most cases Action classes should be treated as
stateless in Struts.

-ed 

On 7/22/05, Vijay K Anand <[EMAIL PROTECTED]> wrote:
> 
> Hi All
> 
> I get error : "java.sql.SQLException: Closed Connection: next "  when
> number of concurrent requests is more
> 
> public class PortfolioMgmtAction extends Action{
>     private Connection con;
> public ActionForward execute(..){
>     this.con = dao.getConnection();
> }
> }
> 
> public class DAO
> {
>     private Connection objConnection;
> 
> public Connection createConnection() {
>         Class.forName("oracle.jdbc.driver.OracleDriver");
> "dashboard");
>         objConnection =
> DriverManager.getConnection("jdbc:oracle:thin:@10.64.34.107:1521:spsdweb",
> "NPI_DBRD_AD", "RTAM70PW");
>         return objConnection;
> 
>     }
> 
> What is the problem in architecture??
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to