Re: Connection pool and MessageRessources

2003-10-31 Thread Ovidiu EFTIMIE
Hi James,
I've studied your solution, and I've noticed that you use a different connection
to the database and not the one that should be availble in an struts
application, and I think that could be a point of failure. That is why I'm
trying tu use the same connection pool as the rest of the application.

Ovidiu

- Original Message - 
From: James Mitchell [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 7:18 PM
Subject: RE: Connection pool and MessageRessources


 Hi Ovidiu

 I also wrote my own DBMessageResources.  With a simple hack, I was able
 to overcome the limitations of the existing API.

 The source code and example are available for download at:


 http://sourceforge.net/project/showfiles.php?group_id=49385release_id=1
 54972



 --
 James Mitchell
 Software Engineer / Struts Evangelist
 http://www.struts-atlanta.org
 678.910.8017 (c)
 770.822.3359 (h)
 AIM:jmitchtx




  -Original Message-
  From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 30, 2003 1:07 PM
  To: [EMAIL PROTECTED]
  Subject: Connection pool and MessageRessources
 
 
  Hi,
  I'm working with Struts 1.1 and I have a problem with the
  MessageRessource and I
  don't know to handle it  the right way.
  In my application I have two constraints,among others :) ,
  - i must use an oci connection to the database
  - the error messages will be stored in the database
  For that I took two aproaches :
  ## One ##:  I have written a Struts plugin which builds the
  connection pool, and
  I've extended MessageRessourceFactory and MessageRessources
  with my own classes
  DBRessourceFactory and DBRessource to have my own mechanism
  for message
  retrivial. My problem is now how can I get a connection to
  the database from the
  connection pool I've just made ? Is there a way to
  communicate between my plugin
  and my DBRessource class ?
 
 
  ## Two ##: I make a class which will handle the connection
  pool creation and the
  retrivial of messages from the database.
  It will look like this :
  public class MessagesDBPool extends MessageRessources implements
  PlugIn,Serializable {
  public MessageDBPool (){
  super();
  }
  public MessageDBPool(MessageRessourcesFactory
  factory,String config){
  this(factory,config,false);
  }
  public MessageDBPool(MessageRessourcesFactory
  factory,String config,boolean
  returnNull){
  super(factory,config,returnNull);
  }
  public void init(ActionServlet servlet, ModuleConfig
  config) throws
  ServletException{
  //pool initialisation here
  }
  public void destroy(){
  //destroy pool here
  }
  }
  Can I do this in the first place ?
 
  Now the question is which one of this two solutions can work?
  Is there another
  way to do this ?
  Any suggestions are welcome .
 
  Thanks,
  Ovidiu EFTIMIE
 
 
 
 
  -
  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]



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



Re: Connection pool and MessageRessources

2003-10-31 Thread Ovidiu EFTIMIE
I think I've found a solution.
I'll make an object (eventualy a struts PlugIn), DBMessage which receivies a
connection from my connection pool and retrives the error messages from the
database, and this object will not extend MessageRessources.
Then in my actions I'll have :

DbMessage dbmesg = (DbMessage)servlet.getAttribute(DBMESG);
String  message = dbmesg.getMessage(error_code);
ActionErrors errors = new ActionError();
errors.add(code,new ActionError(foo,message));

where foo is defined in my application.properties as
foo = {0}

How that sounds ?


Ovidiu

- Original Message - 
From: James Mitchell [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 7:18 PM
Subject: RE: Connection pool and MessageRessources


 Hi Ovidiu

 I also wrote my own DBMessageResources.  With a simple hack, I was able
 to overcome the limitations of the existing API.

 The source code and example are available for download at:


 http://sourceforge.net/project/showfiles.php?group_id=49385release_id=1
 54972



 --
 James Mitchell
 Software Engineer / Struts Evangelist
 http://www.struts-atlanta.org
 678.910.8017 (c)
 770.822.3359 (h)
 AIM:jmitchtx




  -Original Message-
  From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 30, 2003 1:07 PM
  To: [EMAIL PROTECTED]
  Subject: Connection pool and MessageRessources
 
 
  Hi,
  I'm working with Struts 1.1 and I have a problem with the
  MessageRessource and I
  don't know to handle it  the right way.
  In my application I have two constraints,among others :) ,
  - i must use an oci connection to the database
  - the error messages will be stored in the database
  For that I took two aproaches :
  ## One ##:  I have written a Struts plugin which builds the
  connection pool, and
  I've extended MessageRessourceFactory and MessageRessources
  with my own classes
  DBRessourceFactory and DBRessource to have my own mechanism
  for message
  retrivial. My problem is now how can I get a connection to
  the database from the
  connection pool I've just made ? Is there a way to
  communicate between my plugin
  and my DBRessource class ?
 
 
  ## Two ##: I make a class which will handle the connection
  pool creation and the
  retrivial of messages from the database.
  It will look like this :
  public class MessagesDBPool extends MessageRessources implements
  PlugIn,Serializable {
  public MessageDBPool (){
  super();
  }
  public MessageDBPool(MessageRessourcesFactory
  factory,String config){
  this(factory,config,false);
  }
  public MessageDBPool(MessageRessourcesFactory
  factory,String config,boolean
  returnNull){
  super(factory,config,returnNull);
  }
  public void init(ActionServlet servlet, ModuleConfig
  config) throws
  ServletException{
  //pool initialisation here
  }
  public void destroy(){
  //destroy pool here
  }
  }
  Can I do this in the first place ?
 
  Now the question is which one of this two solutions can work?
  Is there another
  way to do this ?
  Any suggestions are welcome .
 
  Thanks,
  Ovidiu EFTIMIE
 
 
 
 
  -
  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]



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



RE: Connection pool and MessageRessources

2003-10-31 Thread James Mitchell
You might not be realizing just how deeply the MesageResources is
integrated with Struts.

Your solution won't work if:

  * your app is using the validator

  * any of your jsp pages are using bean:message

  * any of your jsp pages use tags that use MessageResources
(which are any that use xyzKey such as srcKey, 
 pageKey, altKey, etc)


As far as application modification goes, the extension I 
created is a simple config change in struts-config, and voila!


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




 -Original Message-
 From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED] 
 Sent: Friday, October 31, 2003 7:23 AM
 To: Struts Users Mailing List
 Subject: Re: Connection pool and MessageRessources
 
 
 I think I've found a solution.
 I'll make an object (eventualy a struts PlugIn), DBMessage 
 which receivies a
 connection from my connection pool and retrives the error 
 messages from the
 database, and this object will not extend MessageRessources.
 Then in my actions I'll have :
 
 DbMessage dbmesg = (DbMessage)servlet.getAttribute(DBMESG);
 String  message = dbmesg.getMessage(error_code);
 ActionErrors errors = new ActionError();
 errors.add(code,new ActionError(foo,message));
 
 where foo is defined in my application.properties as
 foo = {0}
 
 How that sounds ?
 
 
 Ovidiu
 
 - Original Message - 
 From: James Mitchell [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Thursday, October 30, 2003 7:18 PM
 Subject: RE: Connection pool and MessageRessources
 
 
  Hi Ovidiu
 
  I also wrote my own DBMessageResources.  With a simple 
 hack, I was able
  to overcome the limitations of the existing API.
 
  The source code and example are available for download at:
 
 
  
 http://sourceforge.net/project/showfiles.php?group_id=49385re
 lease_id=1
  54972
 
 
 
  --
  James Mitchell
  Software Engineer / Struts Evangelist
  http://www.struts-atlanta.org
  678.910.8017 (c)
  770.822.3359 (h)
  AIM:jmitchtx
 
 
 
 
   -Original Message-
   From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
   Sent: Thursday, October 30, 2003 1:07 PM
   To: [EMAIL PROTECTED]
   Subject: Connection pool and MessageRessources
  
  
   Hi,
   I'm working with Struts 1.1 and I have a problem with the
   MessageRessource and I
   don't know to handle it  the right way.
   In my application I have two constraints,among others :) ,
   - i must use an oci connection to the database
   - the error messages will be stored in the database
   For that I took two aproaches :
   ## One ##:  I have written a Struts plugin which builds the
   connection pool, and
   I've extended MessageRessourceFactory and MessageRessources
   with my own classes
   DBRessourceFactory and DBRessource to have my own mechanism
   for message
   retrivial. My problem is now how can I get a connection to
   the database from the
   connection pool I've just made ? Is there a way to
   communicate between my plugin
   and my DBRessource class ?
  
  
   ## Two ##: I make a class which will handle the connection
   pool creation and the
   retrivial of messages from the database.
   It will look like this :
   public class MessagesDBPool extends MessageRessources implements
   PlugIn,Serializable {
   public MessageDBPool (){
   super();
   }
   public MessageDBPool(MessageRessourcesFactory
   factory,String config){
   this(factory,config,false);
   }
   public MessageDBPool(MessageRessourcesFactory
   factory,String config,boolean
   returnNull){
   super(factory,config,returnNull);
   }
   public void init(ActionServlet servlet, ModuleConfig
   config) throws
   ServletException{
   //pool initialisation here
   }
   public void destroy(){
   //destroy pool here
   }
   }
   Can I do this in the first place ?
  
   Now the question is which one of this two solutions can work?
   Is there another
   way to do this ?
   Any suggestions are welcome .
  
   Thanks,
   Ovidiu EFTIMIE
  
  
  
  
   
 -
   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]
 
 
 
 -
 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]



RE: Connection pool and MessageRessources

2003-10-31 Thread James Mitchell
 -Original Message-
 From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED] 
 Sent: Friday, October 31, 2003 5:34 AM
 To: Struts Users Mailing List
 Subject: Re: Connection pool and MessageRessources
 
 
 Hi James,
 I've studied your solution, and I've noticed that you use a 
 different connection
 to the database and not the one that should be availble in an struts
 application, and I think that could be a point of failure. 

No, actually you have that part wrong.  See, my extension uses OJB which
is configured from it's own xml file and not from the struts-config.xml.

Using the existing API (without any special hacks), you have no 
way to pass a connection, the DataSourceConfig, or even get at 
the ModuleConfig from any subclass of MessageResources.  That's why my
solution works without requiring any special coding.

My extension is designed to run independently of your application's
persistence mechanism(s), but if you happen to be using OJB, it's 
all good.

Somewhere on my todo list, is to implement the same extension using each
of the major ORM frameworks.  But like all things, it takes time, and
since I can't put food on the table writing Struts extensions, it'll 
have to wait.


 
 That is why I'm
 trying tu use the same connection pool as the rest of the application.

If your app used OJB, you could do exactly that.

 
 Ovidiu
 


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx



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



Re: Connection pool and MessageRessources

2003-10-31 Thread Ovidiu EFTIMIE
The think is we're not using OJB for this application, but your struts extension
is very interesting  and i'll keep it in my mind for future projects.

Thanks for yout response
Ovidiu

- Original Message - 
From: James Mitchell [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, October 31, 2003 4:13 PM
Subject: RE: Connection pool and MessageRessources


  -Original Message-
  From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
  Sent: Friday, October 31, 2003 5:34 AM
  To: Struts Users Mailing List
  Subject: Re: Connection pool and MessageRessources
 
 
  Hi James,
  I've studied your solution, and I've noticed that you use a
  different connection
  to the database and not the one that should be availble in an struts
  application, and I think that could be a point of failure.

 No, actually you have that part wrong.  See, my extension uses OJB which
 is configured from it's own xml file and not from the struts-config.xml.

 Using the existing API (without any special hacks), you have no
 way to pass a connection, the DataSourceConfig, or even get at
 the ModuleConfig from any subclass of MessageResources.  That's why my
 solution works without requiring any special coding.

 My extension is designed to run independently of your application's
 persistence mechanism(s), but if you happen to be using OJB, it's
 all good.

 Somewhere on my todo list, is to implement the same extension using each
 of the major ORM frameworks.  But like all things, it takes time, and
 since I can't put food on the table writing Struts extensions, it'll
 have to wait.


 
  That is why I'm
  trying tu use the same connection pool as the rest of the application.

 If your app used OJB, you could do exactly that.

 
  Ovidiu
 


 --
 James Mitchell
 Software Engineer / Struts Evangelist
 http://www.struts-atlanta.org
 678.910.8017 (c)
 770.822.3359 (h)
 AIM:jmitchtx



 -
 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]



Re: Connection pool and MessageRessources

2003-10-31 Thread Ovidiu EFTIMIE
Yes I know it is very tighly integrated with Struts, and actualy  we're comply
with all things you've enumerated below.
The validator will not be used because all validation will be done with
javascript already present in the jsp page, and the only server side validation
we'll have will be to find out if the client has disabled javascript, and  we'll
not be using bean:message beacause we'll not have a multi language site.

I know that my solution cannot be universally applied, and it's just a way to
overcome Struts limitations regarding the MessageRessources.
I'll hope that in future versions something similar with your extension could be
integrated into Struts, because is a little bit frustrating to manage error
messages(for example) in two separate places (an Oracle table and
application.properties as in my case).

Thanks for your response, and I hope Id didn't took a lot of your time

Ovidiu

- Original Message - 
From: James Mitchell [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, October 31, 2003 4:13 PM
Subject: RE: Connection pool and MessageRessources


 You might not be realizing just how deeply the MesageResources is
 integrated with Struts.

 Your solution won't work if:

   * your app is using the validator

   * any of your jsp pages are using bean:message

   * any of your jsp pages use tags that use MessageResources
 (which are any that use xyzKey such as srcKey,
  pageKey, altKey, etc)


 As far as application modification goes, the extension I
 created is a simple config change in struts-config, and voila!


 --
 James Mitchell
 Software Engineer / Struts Evangelist
 http://www.struts-atlanta.org
 678.910.8017 (c)
 770.822.3359 (h)
 AIM:jmitchtx




  -Original Message-
  From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
  Sent: Friday, October 31, 2003 7:23 AM
  To: Struts Users Mailing List
  Subject: Re: Connection pool and MessageRessources
 
 
  I think I've found a solution.
  I'll make an object (eventualy a struts PlugIn), DBMessage
  which receivies a
  connection from my connection pool and retrives the error
  messages from the
  database, and this object will not extend MessageRessources.
  Then in my actions I'll have :
 
  DbMessage dbmesg = (DbMessage)servlet.getAttribute(DBMESG);
  String  message = dbmesg.getMessage(error_code);
  ActionErrors errors = new ActionError();
  errors.add(code,new ActionError(foo,message));
 
  where foo is defined in my application.properties as
  foo = {0}
 
  How that sounds ?
 
 
  Ovidiu
 
  - Original Message - 
  From: James Mitchell [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Sent: Thursday, October 30, 2003 7:18 PM
  Subject: RE: Connection pool and MessageRessources
 
 
   Hi Ovidiu
  
   I also wrote my own DBMessageResources.  With a simple
  hack, I was able
   to overcome the limitations of the existing API.
  
   The source code and example are available for download at:
  
  
  
  http://sourceforge.net/project/showfiles.php?group_id=49385re
  lease_id=1
   54972
  
  
  
   --
   James Mitchell
   Software Engineer / Struts Evangelist
   http://www.struts-atlanta.org
   678.910.8017 (c)
   770.822.3359 (h)
   AIM:jmitchtx
  
  
  
  
-Original Message-
From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 1:07 PM
To: [EMAIL PROTECTED]
Subject: Connection pool and MessageRessources
   
   
Hi,
I'm working with Struts 1.1 and I have a problem with the
MessageRessource and I
don't know to handle it  the right way.
In my application I have two constraints,among others :) ,
- i must use an oci connection to the database
- the error messages will be stored in the database
For that I took two aproaches :
## One ##:  I have written a Struts plugin which builds the
connection pool, and
I've extended MessageRessourceFactory and MessageRessources
with my own classes
DBRessourceFactory and DBRessource to have my own mechanism
for message
retrivial. My problem is now how can I get a connection to
the database from the
connection pool I've just made ? Is there a way to
communicate between my plugin
and my DBRessource class ?
   
   
## Two ##: I make a class which will handle the connection
pool creation and the
retrivial of messages from the database.
It will look like this :
public class MessagesDBPool extends MessageRessources implements
PlugIn,Serializable {
public MessageDBPool (){
super();
}
public MessageDBPool(MessageRessourcesFactory
factory,String config){
this(factory,config,false);
}
public MessageDBPool(MessageRessourcesFactory
factory,String config,boolean
returnNull){
super(factory,config,returnNull);
}
public void init(ActionServlet servlet, ModuleConfig
config) throws

RE: Connection pool and MessageRessources

2003-10-31 Thread James Mitchell
As far as what will happen in the future, Struts will be using Resources
from the commons sandbox (well, once it is released).

You should take a look over there for more ideas.

Thanks and good luck!!



--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




 -Original Message-
 From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED] 
 Sent: Friday, October 31, 2003 11:30 AM
 To: Struts Users Mailing List
 Subject: Re: Connection pool and MessageRessources
 
 
 Yes I know it is very tighly integrated with Struts, and 
 actualy  we're comply
 with all things you've enumerated below.
 The validator will not be used because all validation 
 will be done with
 javascript already present in the jsp page, and the only 
 server side validation
 we'll have will be to find out if the client has disabled 
 javascript, and  we'll
 not be using bean:message beacause we'll not have a multi 
 language site.
 
 I know that my solution cannot be universally applied, and 
 it's just a way to
 overcome Struts limitations regarding the MessageRessources.
 I'll hope that in future versions something similar with your 
 extension could be
 integrated into Struts, because is a little bit frustrating 
 to manage error
 messages(for example) in two separate places (an Oracle table and
 application.properties as in my case).
 
 Thanks for your response, and I hope Id didn't took a lot of your time
 
 Ovidiu
 
 - Original Message - 
 From: James Mitchell [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Friday, October 31, 2003 4:13 PM
 Subject: RE: Connection pool and MessageRessources
 
 
  You might not be realizing just how deeply the MesageResources is
  integrated with Struts.
 
  Your solution won't work if:
 
* your app is using the validator
 
* any of your jsp pages are using bean:message
 
* any of your jsp pages use tags that use MessageResources
  (which are any that use xyzKey such as srcKey,
   pageKey, altKey, etc)
 
 
  As far as application modification goes, the extension I
  created is a simple config change in struts-config, and voila!
 
 
  --
  James Mitchell
  Software Engineer / Struts Evangelist
  http://www.struts-atlanta.org
  678.910.8017 (c)
  770.822.3359 (h)
  AIM:jmitchtx
 
 
 
 
   -Original Message-
   From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
   Sent: Friday, October 31, 2003 7:23 AM
   To: Struts Users Mailing List
   Subject: Re: Connection pool and MessageRessources
  
  
   I think I've found a solution.
   I'll make an object (eventualy a struts PlugIn), DBMessage
   which receivies a
   connection from my connection pool and retrives the error
   messages from the
   database, and this object will not extend MessageRessources.
   Then in my actions I'll have :
  
   DbMessage dbmesg = (DbMessage)servlet.getAttribute(DBMESG);
   String  message = dbmesg.getMessage(error_code);
   ActionErrors errors = new ActionError();
   errors.add(code,new ActionError(foo,message));
  
   where foo is defined in my application.properties as
   foo = {0}
  
   How that sounds ?
  
  
   Ovidiu
  
   - Original Message - 
   From: James Mitchell [EMAIL PROTECTED]
   To: 'Struts Users Mailing List' [EMAIL PROTECTED]
   Sent: Thursday, October 30, 2003 7:18 PM
   Subject: RE: Connection pool and MessageRessources
  
  
Hi Ovidiu
   
I also wrote my own DBMessageResources.  With a simple
   hack, I was able
to overcome the limitations of the existing API.
   
The source code and example are available for download at:
   
   
   
   http://sourceforge.net/project/showfiles.php?group_id=49385re
   lease_id=1
54972
   
   
   
--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx
   
   
   
   
 -Original Message-
 From: Ovidiu EFTIMIE 
 [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 30, 2003 1:07 PM
 To: [EMAIL PROTECTED]
 Subject: Connection pool and MessageRessources


 Hi,
 I'm working with Struts 1.1 and I have a problem with the
 MessageRessource and I
 don't know to handle it  the right way.
 In my application I have two constraints,among others :) ,
 - i must use an oci connection to the database
 - the error messages will be stored in the database
 For that I took two aproaches :
 ## One ##:  I have written a Struts plugin which builds the
 connection pool, and
 I've extended MessageRessourceFactory and MessageRessources
 with my own classes
 DBRessourceFactory and DBRessource to have my own mechanism
 for message
 retrivial. My problem is now how can I get a connection to
 the database from the
 connection pool I've just made ? Is there a way to
 communicate between my plugin
 and my DBRessource class

Connection pool and MessageRessources

2003-10-30 Thread Ovidiu EFTIMIE
Hi,
I'm working with Struts 1.1 and I have a problem with the MessageRessource and I
don't know to handle it  the right way.
In my application I have two constraints,among others :) ,
- i must use an oci connection to the database
- the error messages will be stored in the database
For that I took two aproaches :
## One ##:  I have written a Struts plugin which builds the connection pool, and
I've extended MessageRessourceFactory and MessageRessources with my own classes
DBRessourceFactory and DBRessource to have my own mechanism for message
retrivial. My problem is now how can I get a connection to the database from the
connection pool I've just made ? Is there a way to communicate between my plugin
and my DBRessource class ?


## Two ##: I make a class which will handle the connection pool creation and the
retrivial of messages from the database.
It will look like this :
public class MessagesDBPool extends MessageRessources implements
PlugIn,Serializable {
public MessageDBPool (){
super();
}
public MessageDBPool(MessageRessourcesFactory factory,String config){
this(factory,config,false);
}
public MessageDBPool(MessageRessourcesFactory factory,String config,boolean
returnNull){
super(factory,config,returnNull);
}
public void init(ActionServlet servlet, ModuleConfig config) throws
ServletException{
//pool initialisation here
}
public void destroy(){
//destroy pool here
}
}
Can I do this in the first place ?

Now the question is which one of this two solutions can work? Is there another
way to do this ?
Any suggestions are welcome .

Thanks,
Ovidiu EFTIMIE




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



RE: Connection pool and MessageRessources

2003-10-30 Thread James Mitchell
Hi Ovidiu

I also wrote my own DBMessageResources.  With a simple hack, I was able
to overcome the limitations of the existing API.

The source code and example are available for download at:

 
http://sourceforge.net/project/showfiles.php?group_id=49385release_id=1
54972



--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




 -Original Message-
 From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, October 30, 2003 1:07 PM
 To: [EMAIL PROTECTED]
 Subject: Connection pool and MessageRessources
 
 
 Hi,
 I'm working with Struts 1.1 and I have a problem with the 
 MessageRessource and I
 don't know to handle it  the right way.
 In my application I have two constraints,among others :) ,
 - i must use an oci connection to the database
 - the error messages will be stored in the database
 For that I took two aproaches :
 ## One ##:  I have written a Struts plugin which builds the 
 connection pool, and
 I've extended MessageRessourceFactory and MessageRessources 
 with my own classes
 DBRessourceFactory and DBRessource to have my own mechanism 
 for message
 retrivial. My problem is now how can I get a connection to 
 the database from the
 connection pool I've just made ? Is there a way to 
 communicate between my plugin
 and my DBRessource class ?
 
 
 ## Two ##: I make a class which will handle the connection 
 pool creation and the
 retrivial of messages from the database.
 It will look like this :
 public class MessagesDBPool extends MessageRessources implements
 PlugIn,Serializable {
 public MessageDBPool (){
 super();
 }
 public MessageDBPool(MessageRessourcesFactory 
 factory,String config){
 this(factory,config,false);
 }
 public MessageDBPool(MessageRessourcesFactory 
 factory,String config,boolean
 returnNull){
 super(factory,config,returnNull);
 }
 public void init(ActionServlet servlet, ModuleConfig 
 config) throws
 ServletException{
 //pool initialisation here
 }
 public void destroy(){
 //destroy pool here
 }
 }
 Can I do this in the first place ?
 
 Now the question is which one of this two solutions can work? 
 Is there another
 way to do this ?
 Any suggestions are welcome .
 
 Thanks,
 Ovidiu EFTIMIE
 
 
 
 
 -
 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]



Re: Connection Pool: JPetStore Database Layer

2003-06-26 Thread FrenzyGNX
So maybe you can help me with the problem? I have
posted the problem in Commons list and here, but have
got no answer so far. Thanks.

And to be precise, the error is not closed
connection, but broken pipe.

 --- Adam Hardy [EMAIL PROTECTED]
wrote:  I just checked the Apache bugzilla and
couldn't find
 any bugs on this (I 
 queried using closed or connection and got 23
 hits). There are 2 bugs 
 about closed connections, but they are both resolved
 -
 

http://issues.apache.org/bugzilla/show_bug.cgi?id=9073
 

http://issues.apache.org/bugzilla/show_bug.cgi?id=8620
 
 I'm using version 1.0 too. Not had any problems with
 it.
 
 I see there was no reply to that message you quote
 either.
 
 Adam
 
 FrenzyGNX wrote:
  There is a bug in DBCP that will return closed
  connections, even if the validation query is set.
  
 

http://www.mail-archive.com/[EMAIL PROTECTED]/msg66565.html
  
  Also due to the very fact that it is removed from
  Struts 1.1rc2, and there were some discussions
  regarding it in this list earlier on.
  
   --- Adam Hardy [EMAIL PROTECTED]
  wrote:  FrenzyGNX wrote:
  
 My personal experience with DBCP is not good. I
 
 would
 
 avoid it in my next project. 
 
 
  From what point of view were you disappointed?
 
 
 Adam
 
 
 
  
 

-
  
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
  
  
  
  __
  Do You Yahoo!?
  Send free SMS from your PC!
  http://sg.sms.yahoo.com
  
 

-
  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]
  

__
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com

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



Re: Connection Pool: JPetStore Database Layer

2003-06-26 Thread Adam Hardy
love to help but how? I searched for a bug in the Commons bugzilla and 
didn't find one - your best bet would be to establish a test case for 
the problem and post it in bugzilla - you don't need to be an Apache 
developer to search or add bugs to their bugzilla.

FrenzyGNX wrote:
So maybe you can help me with the problem? I have
posted the problem in Commons list and here, but have
got no answer so far. Thanks.
And to be precise, the error is not closed
connection, but broken pipe.
 --- Adam Hardy [EMAIL PROTECTED]
wrote:  I just checked the Apache bugzilla and
couldn't find
any bugs on this (I 
queried using closed or connection and got 23
hits). There are 2 bugs 
about closed connections, but they are both resolved
-


http://issues.apache.org/bugzilla/show_bug.cgi?id=9073


http://issues.apache.org/bugzilla/show_bug.cgi?id=8620

I'm using version 1.0 too. Not had any problems with
it.
I see there was no reply to that message you quote
either.
Adam

FrenzyGNX wrote:

There is a bug in DBCP that will return closed
connections, even if the validation query is set.


http://www.mail-archive.com/[EMAIL PROTECTED]/msg66565.html

Also due to the very fact that it is removed from
Struts 1.1rc2, and there were some discussions
regarding it in this list earlier on.
--- Adam Hardy [EMAIL PROTECTED]
wrote:  FrenzyGNX wrote:

My personal experience with DBCP is not good. I
would


avoid it in my next project. 

From what point of view were you disappointed?

Adam





-

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


__
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com


-

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]


__
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com
-
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]


Re: Connection Pool: JPetStore Database Layer

2003-06-26 Thread FrenzyGNX
Thanks. I have submitted a bug report.

 --- Adam Hardy [EMAIL PROTECTED]
wrote:  love to help but how? I searched for a bug in
the
 Commons bugzilla and 
 didn't find one - your best bet would be to
 establish a test case for 
 the problem and post it in bugzilla - you don't need
 to be an Apache 
 developer to search or add bugs to their bugzilla.
 
 FrenzyGNX wrote:
  So maybe you can help me with the problem? I have
  posted the problem in Commons list and here, but
 have
  got no answer so far. Thanks.
  
  And to be precise, the error is not closed
  connection, but broken pipe.
  
   --- Adam Hardy [EMAIL PROTECTED]
  wrote:  I just checked the Apache bugzilla and
  couldn't find
  
 any bugs on this (I 
 queried using closed or connection and got 23
 hits). There are 2 bugs 
 about closed connections, but they are both
 resolved
 -
 
 
  
 

http://issues.apache.org/bugzilla/show_bug.cgi?id=9073
  
 
 

http://issues.apache.org/bugzilla/show_bug.cgi?id=8620
  
 I'm using version 1.0 too. Not had any problems
 with
 it.
 
 I see there was no reply to that message you quote
 either.
 
 Adam
 
 FrenzyGNX wrote:
 
 There is a bug in DBCP that will return closed
 connections, even if the validation query is set.
 
 
 
 

http://www.mail-archive.com/[EMAIL PROTECTED]/msg66565.html
  
 Also due to the very fact that it is removed from
 Struts 1.1rc2, and there were some discussions
 regarding it in this list earlier on.
 
  --- Adam Hardy
 [EMAIL PROTECTED]
 wrote:  FrenzyGNX wrote:
 
 
 My personal experience with DBCP is not good. I
 
 would
 
 
 avoid it in my next project. 
 
 
 From what point of view were you disappointed?
 
 
 Adam
 
 
 
 
 
 

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

__
 Do You Yahoo!?
 Send free SMS from your PC!
 http://sg.sms.yahoo.com
 
 
 
 

-
  
 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]
  
  
  
  __
  Do You Yahoo!?
  Send free SMS from your PC!
  http://sg.sms.yahoo.com
  
 

-
  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]
  

__
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com

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



Re: Connection Pool: JPetStore Database Layer

2003-06-25 Thread Adam Hardy
FrenzyGNX wrote:
My personal experience with DBCP is not good. I would
avoid it in my next project. 

From what point of view were you disappointed?

Adam

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


Re: Connection Pool: JPetStore Database Layer

2003-06-25 Thread FrenzyGNX
There is a bug in DBCP that will return closed
connections, even if the validation query is set.

http://www.mail-archive.com/[EMAIL PROTECTED]/msg66565.html

Also due to the very fact that it is removed from
Struts 1.1rc2, and there were some discussions
regarding it in this list earlier on.

 --- Adam Hardy [EMAIL PROTECTED]
wrote:  FrenzyGNX wrote:
  My personal experience with DBCP is not good. I
 would
  avoid it in my next project. 
  
 
  From what point of view were you disappointed?
 
 
 Adam
 
 

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

__
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com

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



Re: Connection Pool: JPetStore Database Layer

2003-06-25 Thread Adam Hardy
I just checked the Apache bugzilla and couldn't find any bugs on this (I 
queried using closed or connection and got 23 hits). There are 2 bugs 
about closed connections, but they are both resolved -

http://issues.apache.org/bugzilla/show_bug.cgi?id=9073

http://issues.apache.org/bugzilla/show_bug.cgi?id=8620

I'm using version 1.0 too. Not had any problems with it.

I see there was no reply to that message you quote either.

Adam

FrenzyGNX wrote:
There is a bug in DBCP that will return closed
connections, even if the validation query is set.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg66565.html

Also due to the very fact that it is removed from
Struts 1.1rc2, and there were some discussions
regarding it in this list earlier on.
 --- Adam Hardy [EMAIL PROTECTED]
wrote:  FrenzyGNX wrote:
My personal experience with DBCP is not good. I
would

avoid it in my next project. 

From what point of view were you disappointed?

Adam



-

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


__
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com
-
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]


Connection Pool: JPetStore Database Layer

2003-06-24 Thread Yansheng Lin

Ok, for my next personal project(an online language translator that displays
multiple results), I decided to go with ibatis database layer(from JPetStore)
for db access.  And I expect that a lot of people are going to use my
state-of-art system:). So I need (a) connection pool(s) so that db access won't
be the determining factor in my application.  Which classes I need to modify in
the database layer?  Or I have to create a new ConnectionPool package and get
connection from there?

Any help is greatly appreciated!

Yan


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



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread Yansheng Lin
Found it. But as expected, there is only one real connection.

Maybe I can use commons-dbcp package.


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: June 24, 2003 1:24 PM
To: 'Struts Users Mailing List'
Subject: Connection Pool: JPetStore Database Layer



Ok, for my next personal project(an online language translator that displays
multiple results), I decided to go with ibatis database layer(from JPetStore)
for db access.  And I expect that a lot of people are going to use my
state-of-art system:). So I need (a) connection pool(s) so that db access won't
be the determining factor in my application.  Which classes I need to modify in
the database layer?  Or I have to create a new ConnectionPool package and get
connection from there?

Any help is greatly appreciated!

Yan


-
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]



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread Kumar, Kiran
can some body give me the 
1.complete list of instructions for running a sample struts application and 
2. also list of jar files and link to down load the jar files

I am getting ParserConfiguration Exception and I am unable to start the
server properly



Thanks

KiranKumar (Raj)
ext 7203


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 4:23 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool: JPetStore Database Layer


Found it. But as expected, there is only one real connection.

Maybe I can use commons-dbcp package.


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: June 24, 2003 1:24 PM
To: 'Struts Users Mailing List'
Subject: Connection Pool: JPetStore Database Layer



Ok, for my next personal project(an online language translator that displays
multiple results), I decided to go with ibatis database layer(from
JPetStore)
for db access.  And I expect that a lot of people are going to use my
state-of-art system:). So I need (a) connection pool(s) so that db access
won't
be the determining factor in my application.  Which classes I need to modify
in
the database layer?  Or I have to create a new ConnectionPool package and
get
connection from there?

Any help is greatly appreciated!

Yan


-
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]

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



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread Kumar, Kiran
I need the jar files urgently


Thanks

KiranKumar (Raj)
ext 7203


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 4:23 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool: JPetStore Database Layer


Found it. But as expected, there is only one real connection.

Maybe I can use commons-dbcp package.


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: June 24, 2003 1:24 PM
To: 'Struts Users Mailing List'
Subject: Connection Pool: JPetStore Database Layer



Ok, for my next personal project(an online language translator that displays
multiple results), I decided to go with ibatis database layer(from
JPetStore)
for db access.  And I expect that a lot of people are going to use my
state-of-art system:). So I need (a) connection pool(s) so that db access
won't
be the determining factor in my application.  Which classes I need to modify
in
the database layer?  Or I have to create a new ConnectionPool package and
get
connection from there?

Any help is greatly appreciated!

Yan


-
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]

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



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread Kumar, Kiran



Thanks

KiranKumar (Raj)
ext 7203


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 4:23 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool: JPetStore Database Layer


Found it. But as expected, there is only one real connection.

Maybe I can use commons-dbcp package.


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: June 24, 2003 1:24 PM
To: 'Struts Users Mailing List'
Subject: Connection Pool: JPetStore Database Layer



Ok, for my next personal project(an online language translator that displays
multiple results), I decided to go with ibatis database layer(from
JPetStore)
for db access.  And I expect that a lot of people are going to use my
state-of-art system:). So I need (a) connection pool(s) so that db access
won't
be the determining factor in my application.  Which classes I need to modify
in
the database layer?  Or I have to create a new ConnectionPool package and
get
connection from there?

Any help is greatly appreciated!

Yan


-
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]

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



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread Steve Raeburn
I'll get right on that then :-(

Steve

 -Original Message-
 From: Kumar, Kiran [mailto:[EMAIL PROTECTED]
 Sent: June 24, 2003 1:42 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Connection Pool: JPetStore Database Layer
 
 
 I need the jar files urgently
 
 
 Thanks
 
 KiranKumar (Raj)
 ext 7203
 
 
 -Original Message-
 From: Yansheng Lin [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 24, 2003 4:23 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Connection Pool: JPetStore Database Layer
 
 
 Found it. But as expected, there is only one real connection.
 
 Maybe I can use commons-dbcp package.
 
 
 -Original Message-
 From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
 Sent: June 24, 2003 1:24 PM
 To: 'Struts Users Mailing List'
 Subject: Connection Pool: JPetStore Database Layer
 
 
   
 Ok, for my next personal project(an online language translator 
 that displays
 multiple results), I decided to go with ibatis database layer(from
 JPetStore)
 for db access.  And I expect that a lot of people are going to use my
 state-of-art system:). So I need (a) connection pool(s) so that db access
 won't
 be the determining factor in my application.  Which classes I 
 need to modify
 in
 the database layer?  Or I have to create a new ConnectionPool package and
 get
 connection from there?
 
 Any help is greatly appreciated!
 
 Yan
 
 
 -
 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]
 
 -
 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]



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread Kumar, Kiran
:-))


Thanks

KiranKumar (Raj)
ext 7203


-Original Message-
From: Steve Raeburn [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 5:03 PM
To: Struts Users Mailing List
Subject: RE: Connection Pool: JPetStore Database Layer


I'll get right on that then :-(

Steve

 -Original Message-
 From: Kumar, Kiran [mailto:[EMAIL PROTECTED]
 Sent: June 24, 2003 1:42 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Connection Pool: JPetStore Database Layer
 
 
 I need the jar files urgently
 
 
 Thanks
 
 KiranKumar (Raj)
 ext 7203
 
 
 -Original Message-
 From: Yansheng Lin [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 24, 2003 4:23 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Connection Pool: JPetStore Database Layer
 
 
 Found it. But as expected, there is only one real connection.
 
 Maybe I can use commons-dbcp package.
 
 
 -Original Message-
 From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
 Sent: June 24, 2003 1:24 PM
 To: 'Struts Users Mailing List'
 Subject: Connection Pool: JPetStore Database Layer
 
 
   
 Ok, for my next personal project(an online language translator 
 that displays
 multiple results), I decided to go with ibatis database layer(from
 JPetStore)
 for db access.  And I expect that a lot of people are going to use my
 state-of-art system:). So I need (a) connection pool(s) so that db access
 won't
 be the determining factor in my application.  Which classes I 
 need to modify
 in
 the database layer?  Or I have to create a new ConnectionPool package and
 get
 connection from there?
 
 Any help is greatly appreciated!
 
 Yan
 
 
 -
 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]
 
 -
 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]

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



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread Yansheng Lin
Install tomcat, then find a war file from the struts source download, copy it to
tomcat/webapps directory, finally run tomcat.  You should be able to go to your
demo page at http://localhost:8080/sample.

BTW, can you change the subject next time.  I was hoping to hear someone who's
familiar with the petstore example and the database layer.  I didn't want to
'mess' up a beautiful project before diving into it(my use of DAO and
externalized sql pains me).  

The Mapper project someone told me about was good too, but maybe a bit too
simple and I am not sure how to make it work with DAO framework.




-Original Message-
From: Kumar, Kiran [mailto:[EMAIL PROTECTED] 
Sent: June 24, 2003 2:39 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool: JPetStore Database Layer


can some body give me the 
1.complete list of instructions for running a sample struts application and 
2. also list of jar files and link to down load the jar files

I am getting ParserConfiguration Exception and I am unable to start the
server properly



Thanks

KiranKumar (Raj)
ext 7203


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 4:23 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool: JPetStore Database Layer


Found it. But as expected, there is only one real connection.

Maybe I can use commons-dbcp package.


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: June 24, 2003 1:24 PM
To: 'Struts Users Mailing List'
Subject: Connection Pool: JPetStore Database Layer



Ok, for my next personal project(an online language translator that displays
multiple results), I decided to go with ibatis database layer(from
JPetStore)
for db access.  And I expect that a lot of people are going to use my
state-of-art system:). So I need (a) connection pool(s) so that db access
won't
be the determining factor in my application.  Which classes I need to modify
in
the database layer?  Or I have to create a new ConnectionPool package and
get
connection from there?

Any help is greatly appreciated!

Yan


-
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]

-
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]



RE: Connection Pool: JPetStore Database Layer

2003-06-24 Thread FrenzyGNX
My personal experience with DBCP is not good. I would
avoid it in my next project. 

 --- Yansheng Lin [EMAIL PROTECTED] wrote: 
Found it. But as expected, there is only one real
 connection.
 
 Maybe I can use commons-dbcp package.
 
 
 -Original Message-
 From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
 Sent: June 24, 2003 1:24 PM
 To: 'Struts Users Mailing List'
 Subject: Connection Pool: JPetStore Database Layer
 
 
   
 Ok, for my next personal project(an online language
 translator that displays
 multiple results), I decided to go with ibatis
 database layer(from JPetStore)
 for db access.  And I expect that a lot of people
 are going to use my
 state-of-art system:). So I need (a) connection
 pool(s) so that db access won't
 be the determining factor in my application.  Which
 classes I need to modify in
 the database layer?  Or I have to create a new
 ConnectionPool package and get
 connection from there?
 
 Any help is greatly appreciated!
 
 Yan
 
 

-
 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]
  

__
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com

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



Bitmechanic JDBC Connection Pool or Struts Connection Pool

2003-03-29 Thread niksa_os
I search the [EMAIL PROTECTED] but I didn't find anything on how to setup Bitmechanic 
JDBC Connection Pool.
http://www.bitmechanic.com/projects/jdbcpool/

Does someone can explain me how to setup Bitmechanic in struts-config.xml, web.xml and 
how to get connection in Action?

I use MySQL:
jdbc:mysql://localhost/MyDB
user name:aa
password: bb

Or, does Struts have connection pool?
If yes, how to setup with my MyDB.

Thanks!

Re: Bitmechanic JDBC Connection Pool or Struts Connection Pool

2003-03-29 Thread Dan Tran
http://jakarta.apache.org/struts/faqs/database.html

-D
- Original Message -
From: niksa_os [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 2:28 AM
Subject: Bitmechanic JDBC Connection Pool or Struts Connection Pool


I search the [EMAIL PROTECTED] but I didn't find anything on
how to setup Bitmechanic JDBC Connection Pool.
http://www.bitmechanic.com/projects/jdbcpool/

Does someone can explain me how to setup Bitmechanic in struts-config.xml,
web.xml and how to get connection in Action?

I use MySQL:
jdbc:mysql://localhost/MyDB
user name:aa
password: bb

Or, does Struts have connection pool?
If yes, how to setup with my MyDB.

Thanks!

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



RE: Connection Pool

2003-03-20 Thread Jimmy Emmanual
Dennis, Thank you very much! It works!! By setting the key as a Attribute
of the datasource tag, and NOT a property, i can reference it by its key.

Here is the change i made in the struts-config file:

!-- PRODUCTION/dataexport --
data-source key=prdDataexport 
set-property property=description value=sylDataexport
/
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

Now in the Action Class, i can:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(prdDataexport);

OR you can cast it as a GenericDataSource to print out its properites:

ServletContext context = servlet.getServletContext();
org.apache.struts.util.GenericDataSource genSource = 
 
(org.apache.struts.util.GenericDataSource)context.getAttribute(prdDataexpor
t);

System.out.println(genSource.getDescription());
System.out.println(genSource.getDriverClass());
System.out.println(genSource.getUrl());

This works for Struts 1.0.2. Not sure if it will work with any other
version.

Thanks Dennis and David!!

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: March 19, 2003 10:01 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

Sorry, it's a property of data-source, not data-sources

Best Regards,
Dennis Lee

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:55 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

You can check the DTD, the key is a property of data-sources, so you
should set it in data-sources like this.

data-source key=prdDataexport
set-property property=description value=sylDataexport
...
...
  /data-source

Best Regards,
Dennis Lee

-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:42 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


This is the definition in the struts-config.xml file.

  data-sources
  
!-- PRODUCTION/dataexport --
data-source
set-property property=key value=prdDataexport /
set-property property=description value=sylDataexport
/
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS --
data-source
set-property property=key value=prdGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS4 --
data-source
set-property property=key value=prdGps4 /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS4 /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- REPLICATION/GPS --
data-source
set-property property=key value=repGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:REPLICATION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=REP /
set-property property=password value=REP /
/data-source

!-- TEST/dataexport --
data-source
set-property property=key value=tstDataexport /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/dataexport

Re: Connection Pool

2003-03-20 Thread Stephen Smithstone
Heres how i do it and it works with struts 1.1rc1

in the struts-config i have

data-sources
data-source key=SystemsLog
  set-property value=jdbc:mysql://localhost/SystemsLog property=url 
/
  set-property value=org.gjt.mm.mysql.Driver property=driverClass /
  set-property value=user property=user /
  set-property value=password property=password /
/data-source
  /data-sources

then to get the datasource in a struts action i do

javax.sql.Datasource ds = this.getDatasource( httpServletRequest , 
SystemsLog );

java.sql.Connection conn = ds.getConnection( );

as the Action has a method to retreive a datasource for it



On Thursday 20 March 2003 12:18 am, Jimmy Emmanual wrote:
 How do you access a DataSource from an action class via its key? I have
 multiple DataSources defined in the struts-config.xml file each have the
 key property set. I need to access these based on this key.

 -
 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]



Connection Pool

2003-03-19 Thread Jimmy Emmanual
How do you access a DataSource from an action class via its key? I have
multiple DataSources defined in the struts-config.xml file each have the
key property set. I need to access these based on this key.

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



Re: Connection Pool

2003-03-19 Thread David Graham
Struts stores the DataSources in the ServletContext under the key you 
defined.

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Connection Pool
Date: Wed, 19 Mar 2003 19:18:11 -0500
How do you access a DataSource from an action class via its key? I have
multiple DataSources defined in the struts-config.xml file each have the
key property set. I need to access these based on this key.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


RE: Connection Pool

2003-03-19 Thread Jimmy Emmanual
David,

When i try to access it via the defined key, the DataSource object is null.
The only way it works is if i use the Action.DATA_SOURCE_KEY i.e.

ServletContext context = servlet.getServletContext();
DataSource dataSource =
(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);

If i try something like:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Datasource1);

where Datasource1 is the key in the struts-config.xml file, it doesn't
work...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Connection Pool


Struts stores the DataSources in the ServletContext under the key you 
defined.

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Connection Pool
Date: Wed, 19 Mar 2003 19:18:11 -0500

How do you access a DataSource from an action class via its key? I have
multiple DataSources defined in the struts-config.xml file each have the
key property set. I need to access these based on this key.

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


_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


-
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]



RE: Connection Pool

2003-03-19 Thread David Graham
Are you using modules? Why don't you print out the contents of 
ServletContext to see if it's in there?

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 19:23:40 -0500
David,

When i try to access it via the defined key, the DataSource object is null.
The only way it works is if i use the Action.DATA_SOURCE_KEY i.e.
ServletContext context = servlet.getServletContext();
DataSource dataSource =
(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);
If i try something like:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Datasource1);
where Datasource1 is the key in the struts-config.xml file, it doesn't
work...
-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Connection Pool
Struts stores the DataSources in the ServletContext under the key you
defined.
David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Connection Pool
Date: Wed, 19 Mar 2003 19:18:11 -0500

How do you access a DataSource from an action class via its key? I have
multiple DataSources defined in the struts-config.xml file each have the
key property set. I need to access these based on this key.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
-
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]


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

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


RE: Connection Pool

2003-03-19 Thread Jimmy Emmanual
I don't think i'm using modules. not sure... actually, don't know.

I printed out all the Attributes of the servlet context and there is a
org.apache.sturts.action.DATA_SOURCE object which returns a DataSource.
However, i don't see where ( if any ) there is a list of all the DataSources
i've defined.

I've searched other lists and archives, and nobody seems to be able to get
it to work...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: RE: Connection Pool


Are you using modules? Why don't you print out the contents of 
ServletContext to see if it's in there?

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 19:23:40 -0500

David,

When i try to access it via the defined key, the DataSource object is null.
The only way it works is if i use the Action.DATA_SOURCE_KEY i.e.

ServletContext context = servlet.getServletContext();
DataSource dataSource =
(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);

If i try something like:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Datasource1);

where Datasource1 is the key in the struts-config.xml file, it doesn't
work...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Connection Pool


Struts stores the DataSources in the ServletContext under the key you
defined.

David



 From: Jimmy Emmanual [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: Connection Pool
 Date: Wed, 19 Mar 2003 19:18:11 -0500
 
 How do you access a DataSource from an action class via its key? I have
 multiple DataSources defined in the struts-config.xml file each have the
 key property set. I need to access these based on this key.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


-
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]


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


-
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]



RE: Connection Pool

2003-03-19 Thread Jimmy Emmanual
Also, it seems when you have a list of datasources, the only one that is
recognized is the last one...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: RE: Connection Pool


Are you using modules? Why don't you print out the contents of 
ServletContext to see if it's in there?

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 19:23:40 -0500

David,

When i try to access it via the defined key, the DataSource object is null.
The only way it works is if i use the Action.DATA_SOURCE_KEY i.e.

ServletContext context = servlet.getServletContext();
DataSource dataSource =
(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);

If i try something like:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Datasource1);

where Datasource1 is the key in the struts-config.xml file, it doesn't
work...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Connection Pool


Struts stores the DataSources in the ServletContext under the key you
defined.

David



 From: Jimmy Emmanual [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: Connection Pool
 Date: Wed, 19 Mar 2003 19:18:11 -0500
 
 How do you access a DataSource from an action class via its key? I have
 multiple DataSources defined in the struts-config.xml file each have the
 key property set. I need to access these based on this key.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


-
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]


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


-
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]



RE: Connection Pool

2003-03-19 Thread Lee, Dennis
Hi,

Here is my code snippet:

// initialization - Datasource and Name Service
log.info(Initializing configuration plug in : Datasource
and Name service);
DataSource dataSource = null;
if (StringUtils.isEmpty(desconfig.getDatasource())) {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY);
} else {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(desconfig.getDatasource());

servlet.getServletContext().setAttribute(Action.DATA_SOURCE_KEY,
dataSource);
}

Note:
desconfig.getDatasource() returns a String of my datasource key.
I set the the retrieved datasource to Action.DATA_SOURCE_KEY to easy later
access.

It works for me.

Best Regards,
Dennis Lee

-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 9:59 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Also, it seems when you have a list of datasources, the only one that is
recognized is the last one...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: RE: Connection Pool


Are you using modules? Why don't you print out the contents of 
ServletContext to see if it's in there?

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 19:23:40 -0500

David,

When i try to access it via the defined key, the DataSource object is null.
The only way it works is if i use the Action.DATA_SOURCE_KEY i.e.

ServletContext context = servlet.getServletContext();
DataSource dataSource =
(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);

If i try something like:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Datasource1);

where Datasource1 is the key in the struts-config.xml file, it doesn't
work...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Connection Pool


Struts stores the DataSources in the ServletContext under the key you
defined.

David



 From: Jimmy Emmanual [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: Connection Pool
 Date: Wed, 19 Mar 2003 19:18:11 -0500
 
 How do you access a DataSource from an action class via its key? I have
 multiple DataSources defined in the struts-config.xml file each have the
 key property set. I need to access these based on this key.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


-
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]


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


-
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]


**
This message and any files transmitted with it are confidential and
may be privileged and/or subject to the provision of privacy legislation.
They are intended solely for the use of the individual or entity to whom they are 
addressed. If the reader of this message is not the intended
recipient, please notify the sender immediately and then delete this
message. You are notifed that reliance on, disclosure of, distribution or
copying of this message is prohibited.
Bank of Bermuda
**


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



RE: Connection Pool

2003-03-19 Thread Jimmy Emmanual
Dennis,

Thank you very much. However, what do you declare desconfig as?

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

Here is my code snippet:

// initialization - Datasource and Name Service
log.info(Initializing configuration plug in : Datasource
and Name service);
DataSource dataSource = null;
if (StringUtils.isEmpty(desconfig.getDatasource())) {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY);
} else {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(desconfig.getDatasource());

servlet.getServletContext().setAttribute(Action.DATA_SOURCE_KEY,
dataSource);
}

Note:
desconfig.getDatasource() returns a String of my datasource key.
I set the the retrieved datasource to Action.DATA_SOURCE_KEY to easy later
access.

It works for me.

Best Regards,
Dennis Lee

-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 9:59 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Also, it seems when you have a list of datasources, the only one that is
recognized is the last one...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: RE: Connection Pool


Are you using modules? Why don't you print out the contents of 
ServletContext to see if it's in there?

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 19:23:40 -0500

David,

When i try to access it via the defined key, the DataSource object is null.
The only way it works is if i use the Action.DATA_SOURCE_KEY i.e.

ServletContext context = servlet.getServletContext();
DataSource dataSource =
(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);

If i try something like:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Datasource1);

where Datasource1 is the key in the struts-config.xml file, it doesn't
work...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Connection Pool


Struts stores the DataSources in the ServletContext under the key you
defined.

David



 From: Jimmy Emmanual [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: Connection Pool
 Date: Wed, 19 Mar 2003 19:18:11 -0500
 
 How do you access a DataSource from an action class via its key? I have
 multiple DataSources defined in the struts-config.xml file each have the
 key property set. I need to access these based on this key.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


-
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]


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


-
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]


**
This message and any files transmitted with it are confidential and
may be privileged and/or subject to the provision of privacy legislation.
They are intended solely for the use of the individual or entity to whom
they are addressed. If the reader of this message is not the intended
recipient, please notify the sender immediately and then delete this
message. You are notifed that reliance on, disclosure of, distribution or
copying of this message is prohibited.
Bank of Bermuda
**


-
To unsubscribe, e-mail: [EMAIL PROTECTED

RE: Connection Pool

2003-03-19 Thread Lee, Dennis
Hi,

I declared different datasource for different environment (Development, UAT,
Production).  
desconfig is an object of my Configuration class, it has an attribute
datasource of the type String.  

I am using Struts 1.1b2.

Maybe you should post your datasource setting in struts-config.xml as well.

Best Regards,
Dennis Lee


-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Dennis,

Thank you very much. However, what do you declare desconfig as?

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

Here is my code snippet:

// initialization - Datasource and Name Service
log.info(Initializing configuration plug in : Datasource
and Name service);
DataSource dataSource = null;
if (StringUtils.isEmpty(desconfig.getDatasource())) {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY);
} else {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(desconfig.getDatasource());

servlet.getServletContext().setAttribute(Action.DATA_SOURCE_KEY,
dataSource);
}

Note:
desconfig.getDatasource() returns a String of my datasource key.
I set the the retrieved datasource to Action.DATA_SOURCE_KEY to easy later
access.

It works for me.

Best Regards,
Dennis Lee

-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 9:59 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Also, it seems when you have a list of datasources, the only one that is
recognized is the last one...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: RE: Connection Pool


Are you using modules? Why don't you print out the contents of 
ServletContext to see if it's in there?

David



From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 19:23:40 -0500

David,

When i try to access it via the defined key, the DataSource object is null.
The only way it works is if i use the Action.DATA_SOURCE_KEY i.e.

ServletContext context = servlet.getServletContext();
DataSource dataSource =
(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);

If i try something like:

ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Datasource1);

where Datasource1 is the key in the struts-config.xml file, it doesn't
work...

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 7:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Connection Pool


Struts stores the DataSources in the ServletContext under the key you
defined.

David



 From: Jimmy Emmanual [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: Connection Pool
 Date: Wed, 19 Mar 2003 19:18:11 -0500
 
 How do you access a DataSource from an action class via its key? I have
 multiple DataSources defined in the struts-config.xml file each have the
 key property set. I need to access these based on this key.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


-
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]


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


-
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]


**
This message and any files transmitted with it are confidential and
may be privileged and/or subject to the provision of privacy legislation.
They are intended solely

RE: Connection Pool

2003-03-19 Thread Jimmy Emmanual
This is the definition in the struts-config.xml file.

  data-sources
  
!-- PRODUCTION/dataexport --
data-source
set-property property=key value=prdDataexport /
set-property property=description value=sylDataexport
/
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS --
data-source
set-property property=key value=prdGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS4 --
data-source
set-property property=key value=prdGps4 /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS4 /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- REPLICATION/GPS --
data-source
set-property property=key value=repGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:REPLICATION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=REP /
set-property property=password value=REP /
/data-source

!-- TEST/dataexport --
data-source
set-property property=key value=tstDataexport /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source  

!-- TEST/GPS_QA --
data-source
set-property property=key value=tstGps_qa /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/GPS_QA /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source

  /data-sources

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

I declared different datasource for different environment (Development, UAT,
Production).  
desconfig is an object of my Configuration class, it has an attribute
datasource of the type String.  

I am using Struts 1.1b2.

Maybe you should post your datasource setting in struts-config.xml as well.

Best Regards,
Dennis Lee


-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Dennis,

Thank you very much. However, what do you declare desconfig as?

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

Here is my code snippet:

// initialization - Datasource and Name Service
log.info(Initializing configuration plug in : Datasource
and Name service);
DataSource dataSource = null;
if (StringUtils.isEmpty(desconfig.getDatasource())) {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY);
} else {
dataSource = (DataSource)
servlet.getServletContext().getAttribute(desconfig.getDatasource());

servlet.getServletContext().setAttribute(Action.DATA_SOURCE_KEY

RE: Connection Pool

2003-03-19 Thread David Graham
The set-property element calls a setter on the DataSource java bean.  Use 
the key attribute of the data-source element to assign keys.  See the 
struts-config.xml DTD for details.

David




From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 21:41:32 -0500
This is the definition in the struts-config.xml file.

  data-sources

!-- PRODUCTION/dataexport --
data-source
set-property property=key value=prdDataexport /
set-property property=description value=sylDataexport
/
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source
!-- PRODUCTION/GPS --
data-source
set-property property=key value=prdGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source
!-- PRODUCTION/GPS4 --
data-source
set-property property=key value=prdGps4 /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS4 /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source
!-- REPLICATION/GPS --
data-source
set-property property=key value=repGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:REPLICATION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=REP /
set-property property=password value=REP /
/data-source
!-- TEST/dataexport --
data-source
set-property property=key value=tstDataexport /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source
!-- TEST/GPS_QA --
data-source
set-property property=key value=tstGps_qa /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/GPS_QA /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source
  /data-sources

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool
Hi,

I declared different datasource for different environment (Development, 
UAT,
Production).
desconfig is an object of my Configuration class, it has an attribute
datasource of the type String.

I am using Struts 1.1b2.

Maybe you should post your datasource setting in struts-config.xml as well.

Best Regards,
Dennis Lee
-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool
Dennis,

Thank you very much. However, what do you declare desconfig as?

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool
Hi,

Here is my code snippet:

// initialization - Datasource and Name Service
log.info(Initializing configuration plug in : Datasource
and Name service);
DataSource dataSource = null;
if (StringUtils.isEmpty

RE: Connection Pool

2003-03-19 Thread Jimmy Emmanual
Thanks, i'll look at the DTD for more info...

I thought that was what i was doing with set-property property=key
value=prdDataexport /. Almost every document i've read says i should be
able to get the datasource via the key prdDataexport, but the only way i
get it is when i use the default Action.DATA_SOURCE_KEY...

Also, i'm using struts 1.0.2.

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:49 PM
To: [EMAIL PROTECTED]
Subject: RE: Connection Pool


The set-property element calls a setter on the DataSource java bean.  Use 
the key attribute of the data-source element to assign keys.  See the 
struts-config.xml DTD for details.

David




From: Jimmy Emmanual [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Connection Pool
Date: Wed, 19 Mar 2003 21:41:32 -0500

This is the definition in the struts-config.xml file.

   data-sources

   !-- PRODUCTION/dataexport --
   data-source
   set-property property=key value=prdDataexport /
   set-property property=description value=sylDataexport
/
   set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
   set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/dataexport /
   set-property property=maxCount value=10 /
   set-property property=minCount value=1 /
   set-property property=user value=PRD /
   set-property property=password value=PRD /
   /data-source

   !-- PRODUCTION/GPS --
   data-source
   set-property property=key value=prdGps /
   set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
   set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS /
   set-property property=maxCount value=10 /
   set-property property=minCount value=1 /
   set-property property=user value=PRD /
   set-property property=password value=PRD /
   /data-source

   !-- PRODUCTION/GPS4 --
   data-source
   set-property property=key value=prdGps4 /
   set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
   set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS4 /
   set-property property=maxCount value=10 /
   set-property property=minCount value=1 /
   set-property property=user value=PRD /
   set-property property=password value=PRD /
   /data-source

   !-- REPLICATION/GPS --
   data-source
   set-property property=key value=repGps /
   set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
   set-property property=url
value=jdbc:sybase:Tds:REPLICATION:4100/GPS /
   set-property property=maxCount value=10 /
   set-property property=minCount value=1 /
   set-property property=user value=REP /
   set-property property=password value=REP /
   /data-source

   !-- TEST/dataexport --
   data-source
   set-property property=key value=tstDataexport /
   set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
   set-property property=url
value=jdbc:sybase:Tds:TEST:4100/dataexport /
   set-property property=maxCount value=10 /
   set-property property=minCount value=1 /
   set-property property=user value=TST /
   set-property property=password value=TST /
   /data-source

   !-- TEST/GPS_QA --
   data-source
   set-property property=key value=tstGps_qa /
   set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
   set-property property=url
value=jdbc:sybase:Tds:TEST:4100/GPS_QA /
   set-property property=maxCount value=10 /
   set-property property=minCount value=1 /
   set-property property=user value=TST /
   set-property property=password value=TST /
   /data-source

   /data-sources

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

I declared different datasource for different environment (Development, 
UAT,
Production).
desconfig is an object of my Configuration class, it has an attribute
datasource of the type String.

I am using Struts 1.1b2.

Maybe you should post your datasource setting in struts-config.xml as well.

Best Regards,
Dennis Lee


-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Dennis,

Thank you very much. However, what do you declare

RE: Connection Pool

2003-03-19 Thread Lee, Dennis
Hi,

You can check the DTD, the key is a property of data-sources, so you
should set it in data-sources like this.

data-source key=prdDataexport
set-property property=description value=sylDataexport
...
...
  /data-source

Best Regards,
Dennis Lee

-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:42 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


This is the definition in the struts-config.xml file.

  data-sources
  
!-- PRODUCTION/dataexport --
data-source
set-property property=key value=prdDataexport /
set-property property=description value=sylDataexport
/
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS --
data-source
set-property property=key value=prdGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS4 --
data-source
set-property property=key value=prdGps4 /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS4 /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- REPLICATION/GPS --
data-source
set-property property=key value=repGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:REPLICATION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=REP /
set-property property=password value=REP /
/data-source

!-- TEST/dataexport --
data-source
set-property property=key value=tstDataexport /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source  

!-- TEST/GPS_QA --
data-source
set-property property=key value=tstGps_qa /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/GPS_QA /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source

  /data-sources

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

I declared different datasource for different environment (Development, UAT,
Production).  
desconfig is an object of my Configuration class, it has an attribute
datasource of the type String.  

I am using Struts 1.1b2.

Maybe you should post your datasource setting in struts-config.xml as well.

Best Regards,
Dennis Lee


-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Dennis,

Thank you very much. However, what do you declare desconfig as?

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

Here is my code snippet:

// initialization - Datasource and Name Service
log.info(Initializing configuration plug

RE: Connection Pool

2003-03-19 Thread Lee, Dennis
Hi,

Sorry, it's a property of data-source, not data-sources

Best Regards,
Dennis Lee

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:55 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

You can check the DTD, the key is a property of data-sources, so you
should set it in data-sources like this.

data-source key=prdDataexport
set-property property=description value=sylDataexport
...
...
  /data-source

Best Regards,
Dennis Lee

-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:42 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


This is the definition in the struts-config.xml file.

  data-sources
  
!-- PRODUCTION/dataexport --
data-source
set-property property=key value=prdDataexport /
set-property property=description value=sylDataexport
/
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS --
data-source
set-property property=key value=prdGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- PRODUCTION/GPS4 --
data-source
set-property property=key value=prdGps4 /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:PRODUCTION:4100/GPS4 /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=PRD /
set-property property=password value=PRD /
/data-source

!-- REPLICATION/GPS --
data-source
set-property property=key value=repGps /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:REPLICATION:4100/GPS /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=REP /
set-property property=password value=REP /
/data-source

!-- TEST/dataexport --
data-source
set-property property=key value=tstDataexport /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/dataexport /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source  

!-- TEST/GPS_QA --
data-source
set-property property=key value=tstGps_qa /
set-property property=driverClass
value=com.sybase.jdbc2.jdbc.SybDriver /
set-property property=url
value=jdbc:sybase:Tds:TEST:4100/GPS_QA /
set-property property=maxCount value=10 /
set-property property=minCount value=1 /
set-property property=user value=TST /
set-property property=password value=TST /
/data-source

  /data-sources

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 9:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Hi,

I declared different datasource for different environment (Development, UAT,
Production).  
desconfig is an object of my Configuration class, it has an attribute
datasource of the type String.  

I am using Struts 1.1b2.

Maybe you should post your datasource setting in struts-config.xml as well.

Best Regards,
Dennis Lee


-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: RE: Connection Pool


Dennis,

Thank you very much. However, what do you declare desconfig as?

-Original Message-
From: Lee, Dennis [mailto:[EMAIL PROTECTED

DB Connection pool (how)?

2003-02-19 Thread Swish
Hi,

  Please excuse my ignorance, but does struts have a
libraries that implement a connection pool and if so,
how does one configure and use this pool?   Are there
any examples?  Any help will be greatly appreciated! 
Thanks in advance!

__ 
Post your free ad now! http://personals.yahoo.ca

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




Re: DB Connection pool (how)?

2003-02-19 Thread David Graham
http://jakarta.apache.org/struts/userGuide/configuration.html#data-source_config

David




From: Swish [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: DB Connection pool (how)?
Date: Wed, 19 Feb 2003 11:32:15 -0500 (EST)

Hi,

  Please excuse my ignorance, but does struts have a
libraries that implement a connection pool and if so,
how does one configure and use this pool?   Are there
any examples?  Any help will be greatly appreciated!
Thanks in advance!

__
Post your free ad now! http://personals.yahoo.ca

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



_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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



RE: DB Connection pool (how)?

2003-02-19 Thread James Mitchell
http://jakarta.apache.org/struts/faqs/database.html



--
James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org/

The man who does not read good books has no advantage over the man who
cannot read them.
- Mark Twain (1835-1910)







 -Original Message-
 From: Swish [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, February 19, 2003 11:32 AM
 To: Struts Users Mailing List
 Subject: DB Connection pool (how)?
 
 
 Hi,
 
   Please excuse my ignorance, but does struts have a
 libraries that implement a connection pool and if so,
 how does one configure and use this pool?   Are there
 any examples?  Any help will be greatly appreciated! 
 Thanks in advance!
 
 __
  
 Post your free ad now! http://personals.yahoo.ca
 
 -
 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]




Re: DB Connection pool (how)?

2003-02-19 Thread asatrasala
Hello,
FYI,  
I use MSSQL server and opta2000.jar from
http://www.inetsoftware.de/English/produkte/JDBC_Overview/default.htm

Following are my parameters in struts-config.xml file
 data-sources
   data-source
 set-property property=description
  value=test sample datasource/
 set-property property=autoCommit
  value=false/
 set-property property=driverClass
  value=com.inet.tds.TdsDriver/
 set-property property=maxCount
  value=4/
 set-property property=password
  value=guest/
 set-property property=url
  value=jdbc:inetdae7:localhost:1433?database=test/
 set-property property=user
  value=guest/
   /data-source
 /data-sources



[EMAIL PROTECTED] wrote:

Hi,

 Please excuse my ignorance, but does struts have a
libraries that implement a connection pool and if so,
how does one configure and use this pool?   Are there
any examples?  Any help will be greatly appreciated! 
Thanks in advance!

__ 
Post your free ad now! http://personals.yahoo.ca

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

 


--
Your favorite stores, helpful shopping tools and great gift ideas. 
Experience the convenience of buying online with Shop@Netscape! 
http://shopnow.netscape.com/



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



RE: DB Connection pool (how)?

2003-02-19 Thread Swish
Thanks!!  Wow, struts is an awesome framework!

--- James Mitchell [EMAIL PROTECTED] wrote: 
http://jakarta.apache.org/struts/faqs/database.html
 
 
 
 --
 James Mitchell
 Software Engineer/Struts Evangelist
 http://www.open-tools.org/
 
 The man who does not read good books has no
 advantage over the man who
 cannot read them.
   - Mark Twain (1835-1910)
 
 
 
 
 
 
 
  -Original Message-
  From: Swish [mailto:[EMAIL PROTECTED]] 
  Sent: Wednesday, February 19, 2003 11:32 AM
  To: Struts Users Mailing List
  Subject: DB Connection pool (how)?
  
  
  Hi,
  
Please excuse my ignorance, but does struts have
 a
  libraries that implement a connection pool and if
 so,
  how does one configure and use this pool?   Are
 there
  any examples?  Any help will be greatly
 appreciated! 
  Thanks in advance!
  
 

__
   
  Post your free ad now! http://personals.yahoo.ca
  
 

-
  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]
  

__ 
Post your free ad now! http://personals.yahoo.ca

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




DBCP could not obtain an idle db connection pool exhausted

2003-02-19 Thread Scott Power
Hi folks,

Here's my situation, I am using tomcat(latest version) and
mysql,jdbc(mysql ..connector..jar) and struts for an application with
connection pooling.  I can not figure out why my connection stay around
once I close them, they are not sent back to the pool.

I create a connection then I 

Connection myConnection = utilclass.getDbConnection();

the getDBconnetion() method is here:

public Connection getDbConnection() {
String contextString = java:comp/env/jdbc/cms;
Connection localConnection = null;
DataSource myBasicDataSource = null;

try {
Context myContext = new InitialContext();
myBasicDataSource = (DataSource)
myContext.lookup(contextString);
localConnection =
myBasicDataSource.getConnection();
}
   ..return localConnection;


I use the connection for a statement and a result set.

I close the connection
 myConnection .close();

I have also found out that you should be closing the result set and the
statement also, which I have tried but that did not resolve my problem. 
When I check out the DB I see the connections that are created during
the application but they remain there in sleep until tomcat is
shutdown.

I have added the following to my server.xml to clean up connections

  nameremoveAbandoned/name
  valuetrue/value
/parameter
parameter
  nameremoveAbandonedTimeout/name
  value10/value
/parameter
parameter
  namelogAbandoned/name
  valuetrue/value
/parameter

but this does not seem to work, I added it in the jdbc resource params
section.  Is there a way to clean up these connections that are lying
around.  I connect many times to the db and I thought that in the end of
things I should only have one connection left, all the other connections
were closed but not reclaimed.

I could really use some help on this one.

Thanks 

Scott




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




RE: DBCP could not obtain an idle db connection pool exhausted

2003-02-19 Thread Brandon Goodin
try making your getDbConnection method static. It might be holding a
reference to your utilclass that you have instantiated. It might be taking
longer to gc the class. This is just a guess.

Example:

public static Connection getDbConnection() {

...

}

Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Scott Power [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 19, 2003 11:11 AM
To: [EMAIL PROTECTED]
Subject: DBCP could not obtain an idle db connection pool exhausted


Hi folks,

Here's my situation, I am using tomcat(latest version) and
mysql,jdbc(mysql ..connector..jar) and struts for an application with
connection pooling.  I can not figure out why my connection stay around
once I close them, they are not sent back to the pool.

I create a connection then I

Connection myConnection = utilclass.getDbConnection();

the getDBconnetion() method is here:

public Connection getDbConnection() {
String contextString = java:comp/env/jdbc/cms;
Connection localConnection = null;
DataSource myBasicDataSource = null;

try {
Context myContext = new InitialContext();
myBasicDataSource = (DataSource)
myContext.lookup(contextString);
localConnection =
myBasicDataSource.getConnection();
}
   ..return localConnection;


I use the connection for a statement and a result set.

I close the connection
 myConnection .close();

I have also found out that you should be closing the result set and the
statement also, which I have tried but that did not resolve my problem.
When I check out the DB I see the connections that are created during
the application but they remain there in sleep until tomcat is
shutdown.

I have added the following to my server.xml to clean up connections

  nameremoveAbandoned/name
  valuetrue/value
/parameter
parameter
  nameremoveAbandonedTimeout/name
  value10/value
/parameter
parameter
  namelogAbandoned/name
  valuetrue/value
/parameter

but this does not seem to work, I added it in the jdbc resource params
section.  Is there a way to clean up these connections that are lying
around.  I connect many times to the db and I thought that in the end of
things I should only have one connection left, all the other connections
were closed but not reclaimed.

I could really use some help on this one.

Thanks

Scott




-
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]




RE: DB Connection pool (how)?

2003-02-19 Thread James Mitchell
Amen brother!!!  Now go ye into all the nations and spread the Struts
gospel!!!


--
James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org/

The man who does not read good books has no advantage over the man who
cannot read them.
- Mark Twain (1835-1910)




 -Original Message-
 From: Swish [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, February 19, 2003 12:28 PM
 To: Struts Users Mailing List
 Subject: RE: DB Connection pool (how)?
 
 
 Thanks!!  Wow, struts is an awesome framework!
 
 --- James Mitchell [EMAIL PROTECTED] wrote: 
 http://jakarta.apache.org/struts/faqs/database.html
  
  
  
  --
  James Mitchell
  Software Engineer/Struts Evangelist
  http://www.open-tools.org/
  
  The man who does not read good books has no
  advantage over the man who
  cannot read them.
  - Mark Twain (1835-1910)
  
  
  
  
  
  
  
   -Original Message-
   From: Swish [mailto:[EMAIL PROTECTED]] 
   Sent: Wednesday, February 19, 2003 11:32 AM
   To: Struts Users Mailing List
   Subject: DB Connection pool (how)?
   
   
   Hi,
   
 Please excuse my ignorance, but does struts have
  a
   libraries that implement a connection pool and if
  so,
   how does one configure and use this pool?   Are
  there
   any examples?  Any help will be greatly
  appreciated! 
   Thanks in advance!
   
  
 
 __
    
   Post your free ad now! http://personals.yahoo.ca
   
  
 
 -
   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]
   
 
 __
  
 Post your free ad now! http://personals.yahoo.ca
 
 -
 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]




RE: DBCP could not obtain an idle db connection pool exhausted

2003-02-19 Thread Jarnot Voytek Contr AU HQ/SC
It would also be a good idea to only do the DataSource lookup one time, and
cache it...

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


 -Original Message-
 From: Brandon Goodin [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 19, 2003 12:54 PM
 To: Struts Users Mailing List
 Subject: RE: DBCP could not obtain an idle db connection pool 
 exhausted
 
 
 try making your getDbConnection method static. It might be holding a
 reference to your utilclass that you have instantiated. It 
 might be taking
 longer to gc the class. This is just a guess.
 
 Example:
 
 public static Connection getDbConnection() {
 
   ...
 
 }
 
 Brandon Goodin
 Phase Web and Multimedia
 PO Box 85
 Whitefish MT 59937
 P (406) 862-2245
 F (406) 862-0354
 [EMAIL PROTECTED]
 http://www.phase.ws
 
 
 -Original Message-
 From: Scott Power [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 19, 2003 11:11 AM
 To: [EMAIL PROTECTED]
 Subject: DBCP could not obtain an idle db connection pool exhausted
 
 
 Hi folks,
 
 Here's my situation, I am using tomcat(latest version) and
 mysql,jdbc(mysql ..connector..jar) and struts for an application with
 connection pooling.  I can not figure out why my connection 
 stay around
 once I close them, they are not sent back to the pool.
 
 I create a connection then I
 
   Connection myConnection = utilclass.getDbConnection();
 
 the getDBconnetion() method is here:
 
   public Connection getDbConnection() {
   String contextString = java:comp/env/jdbc/cms;
   Connection localConnection = null;
   DataSource myBasicDataSource = null;
 
   try {
   Context myContext = new InitialContext();
   myBasicDataSource = (DataSource)
 myContext.lookup(contextString);
   localConnection =
 myBasicDataSource.getConnection();
   }
..return localConnection;
 
 
 I use the connection for a statement and a result set.
 
 I close the connection
  myConnection .close();
 
 I have also found out that you should be closing the result 
 set and the
 statement also, which I have tried but that did not resolve 
 my problem.
 When I check out the DB I see the connections that are created during
 the application but they remain there in sleep until tomcat is
 shutdown.
 
 I have added the following to my server.xml to clean up connections
 
   nameremoveAbandoned/name
   valuetrue/value
 /parameter
 parameter
   nameremoveAbandonedTimeout/name
   value10/value
 /parameter
 parameter
   namelogAbandoned/name
   valuetrue/value
 /parameter
 
 but this does not seem to work, I added it in the jdbc resource params
 section.  Is there a way to clean up these connections that are lying
 around.  I connect many times to the db and I thought that in 
 the end of
 things I should only have one connection left, all the other 
 connections
 were closed but not reclaimed.
 
 I could really use some help on this one.
 
 Thanks
 
 Scott
 
 
 
 
 -
 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]
 

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




RE: DBCP could not obtain an idle db connection pool exhausted

2003-02-19 Thread Brandon Goodin
How much advantage is caching the datasource lookup? Isn't that the whole
idea of a ConnectionPool and the jndi lookup. Isn't the registry just
pointing to a persistent object resource? I am curious what kind of
performance boost one gets when caching a DataSource Lookup.

Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 19, 2003 11:57 AM
To: 'Struts Users Mailing List'
Subject: RE: DBCP could not obtain an idle db connection pool exhausted


It would also be a good idea to only do the DataSource lookup one time, and
cache it...

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


 -Original Message-
 From: Brandon Goodin [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 19, 2003 12:54 PM
 To: Struts Users Mailing List
 Subject: RE: DBCP could not obtain an idle db connection pool
 exhausted


 try making your getDbConnection method static. It might be holding a
 reference to your utilclass that you have instantiated. It
 might be taking
 longer to gc the class. This is just a guess.

 Example:

 public static Connection getDbConnection() {

   ...

 }

 Brandon Goodin
 Phase Web and Multimedia
 PO Box 85
 Whitefish MT 59937
 P (406) 862-2245
 F (406) 862-0354
 [EMAIL PROTECTED]
 http://www.phase.ws


 -Original Message-
 From: Scott Power [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 19, 2003 11:11 AM
 To: [EMAIL PROTECTED]
 Subject: DBCP could not obtain an idle db connection pool exhausted


 Hi folks,

 Here's my situation, I am using tomcat(latest version) and
 mysql,jdbc(mysql ..connector..jar) and struts for an application with
 connection pooling.  I can not figure out why my connection
 stay around
 once I close them, they are not sent back to the pool.

 I create a connection then I

   Connection myConnection = utilclass.getDbConnection();

 the getDBconnetion() method is here:

   public Connection getDbConnection() {
   String contextString = java:comp/env/jdbc/cms;
   Connection localConnection = null;
   DataSource myBasicDataSource = null;

   try {
   Context myContext = new InitialContext();
   myBasicDataSource = (DataSource)
 myContext.lookup(contextString);
   localConnection =
 myBasicDataSource.getConnection();
   }
..return localConnection;


 I use the connection for a statement and a result set.

 I close the connection
  myConnection .close();

 I have also found out that you should be closing the result
 set and the
 statement also, which I have tried but that did not resolve
 my problem.
 When I check out the DB I see the connections that are created during
 the application but they remain there in sleep until tomcat is
 shutdown.

 I have added the following to my server.xml to clean up connections

   nameremoveAbandoned/name
   valuetrue/value
 /parameter
 parameter
   nameremoveAbandonedTimeout/name
   value10/value
 /parameter
 parameter
   namelogAbandoned/name
   valuetrue/value
 /parameter

 but this does not seem to work, I added it in the jdbc resource params
 section.  Is there a way to clean up these connections that are lying
 around.  I connect many times to the db and I thought that in
 the end of
 things I should only have one connection left, all the other
 connections
 were closed but not reclaimed.

 I could really use some help on this one.

 Thanks

 Scott




 -
 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]


-
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]




[OT] RE: DBCP could not obtain an idle db connection pool exhausted

2003-02-19 Thread Jarnot Voytek Contr AU HQ/SC
I don't know how much advantage it is ... I have just never seen the point
of doing the jndi lookup more than once.

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


 -Original Message-
 From: Brandon Goodin [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 19, 2003 1:09 PM
 To: Struts Users Mailing List
 Subject: RE: DBCP could not obtain an idle db connection pool 
 exhausted
 
 
 How much advantage is caching the datasource lookup? Isn't 
 that the whole
 idea of a ConnectionPool and the jndi lookup. Isn't the registry just
 pointing to a persistent object resource? I am curious what kind of
 performance boost one gets when caching a DataSource Lookup.
 
 Brandon Goodin
 Phase Web and Multimedia
 PO Box 85
 Whitefish MT 59937
 P (406) 862-2245
 F (406) 862-0354
 [EMAIL PROTECTED]
 http://www.phase.ws
 
 
 -Original Message-
 From: Jarnot Voytek Contr AU HQ/SC 
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 19, 2003 11:57 AM
 To: 'Struts Users Mailing List'
 Subject: RE: DBCP could not obtain an idle db connection pool 
 exhausted
 
 
 It would also be a good idea to only do the DataSource lookup 
 one time, and
 cache it...
 
 --
 Voytek Jarnot
 Quidquid latine dictum sit, altum viditur.
 
 
  -Original Message-
  From: Brandon Goodin [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 19, 2003 12:54 PM
  To: Struts Users Mailing List
  Subject: RE: DBCP could not obtain an idle db connection pool
  exhausted
 
 
  try making your getDbConnection method static. It might be holding a
  reference to your utilclass that you have instantiated. It
  might be taking
  longer to gc the class. This is just a guess.
 
  Example:
 
  public static Connection getDbConnection() {
 
  ...
 
  }
 
  Brandon Goodin
  Phase Web and Multimedia
  PO Box 85
  Whitefish MT 59937
  P (406) 862-2245
  F (406) 862-0354
  [EMAIL PROTECTED]
  http://www.phase.ws
 
 
  -Original Message-
  From: Scott Power [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 19, 2003 11:11 AM
  To: [EMAIL PROTECTED]
  Subject: DBCP could not obtain an idle db connection pool exhausted
 
 
  Hi folks,
 
  Here's my situation, I am using tomcat(latest version) and
  mysql,jdbc(mysql ..connector..jar) and struts for an 
 application with
  connection pooling.  I can not figure out why my connection
  stay around
  once I close them, they are not sent back to the pool.
 
  I create a connection then I
 
  Connection myConnection = utilclass.getDbConnection();
 
  the getDBconnetion() method is here:
 
  public Connection getDbConnection() {
  String contextString = java:comp/env/jdbc/cms;
  Connection localConnection = null;
  DataSource myBasicDataSource = null;
 
  try {
  Context myContext = new InitialContext();
  myBasicDataSource = (DataSource)
  myContext.lookup(contextString);
  localConnection =
  myBasicDataSource.getConnection();
  }
 ..return localConnection;
 
 
  I use the connection for a statement and a result set.
 
  I close the connection
   myConnection .close();
 
  I have also found out that you should be closing the result
  set and the
  statement also, which I have tried but that did not resolve
  my problem.
  When I check out the DB I see the connections that are 
 created during
  the application but they remain there in sleep until tomcat is
  shutdown.
 
  I have added the following to my server.xml to clean up connections
 
nameremoveAbandoned/name
valuetrue/value
  /parameter
  parameter
nameremoveAbandonedTimeout/name
value10/value
  /parameter
  parameter
namelogAbandoned/name
valuetrue/value
  /parameter
 
  but this does not seem to work, I added it in the jdbc 
 resource params
  section.  Is there a way to clean up these connections that 
 are lying
  around.  I connect many times to the db and I thought that in
  the end of
  things I should only have one connection left, all the other
  connections
  were closed but not reclaimed.
 
  I could really use some help on this one.
 
  Thanks
 
  Scott
 
 
 
 
  
 -
  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]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED

insert problem with struts connection pool

2003-01-24 Thread Erhan Sen




Hi,
I am using DB2 7.2 for win,struts 1.1 beta2 ver.
I can use connection pool in select statements,and I have no problem.On the 
other hand when I tried insert statements I got no exceptions, but no data 
is inserted.
But when I only change  the connection from :
dataSource = 
(DataSource)servlet.getServletContext().getAttribute(org.apache.struts.action.DATA_SOURCE);
conn=dataSource.getConnection();
to:
Class.forName(COM.ibm.db2.jdbc.net.DB2Driver);
conn=java.sql.DriverManager.getConnection(jdbc:db2/localhost:50006/XX,username,password);
I can insert data with the same query string.
My data source conf in struts-config looks like:
 data-sources
   data-source
 set-property property=autoCommit
  value=false/
 set-property property=description
  value=DB2 Query/
 set-property property=driverClass
  value=COM.ibm.db2.jdbc.net.DB2Driver/
 set-property property=maxCount
  value=4/
 set-property property=minCount
  value=2/
 set-property property=password
  value=password/
 set-property property=url
  value=jdbc:db2/localhost:50006/XX/
 set-property property=user
  value=username/
   /data-source
 /data-sources

Is it a bug or a configuration or a programming problem?Any idea


_
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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



RE: db connection pool question [solved]

2003-01-23 Thread Raible, Matt
Using the following in my DBCP Connection Pool solved my problem:

parameter
namedriverClassName/name
valueoracle.jdbc.pool.OracleConnectionPoolDataSource/value
/parameter

However, for the JDBCRealm, I still have to use:

driverName=oracle.jdbc.driver.OracleDriver

Thanks,

Matt

 -Original Message-
 From: mech [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 12:10 PM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 I can't tell for Oracle, but for MySQL and the Struts Connection Pool
 you have to set some kind of autoReconnect=true for your connection
 url setup. Otherwise your connection pool will contain only stale
 connections after a certain timeout. 
 MySQL kicked me out after 8 hours of inactivity. 
 Without autoreconnect you will just pick a dead connection 
 out of this
 pool, get an exception, most likely even close the broken 
 connection in
 your finally-block and put it back into the pool. Next time you grab
 another dead connection and so on and forth.
 
 By the way... Are the certain pro and cons for the struts connection
 pool vs. the tomcat datasource connection pool?
 As far as I know the tomcat connection pool works only via jndi setup
 whereas struts utilized the oldfashioned way. And moreover 
 you have to
 set it up in struts-config.xml which is a bit tricky for deployment.
 
 Michael
 
  -Original Message-
  From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
  Sent: Mittwoch, 22. Januar 2003 17:18
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
  
  
  After waiting 24 hours, I'm still experiencing the same 
  problem with Oracle and a connection pool (DBCP) in Tomcat.  
  I guess I'll try configuring Oracle's connection pool??
  
  Matt
  
   -Original Message-
   From: Raible, Matt
   Sent: Tuesday, January 21, 2003 8:22 AM
   To: 'Struts Users Mailing List'
   Subject: RE: db connection pool question
   
   
   Actually, the solution that I had only works for MySQL.  I'm
   having the same problem with Oracle.  Funny - I just posted a 
   message to the commons-user group asking this same question.  
   I'll try adding the validationQuery parameter:
   
   parameter
  namevalidationQuery/name
  valueSELECT 'CRAP' FROM DUAL/value /parameter
   
   Thanks,
   
   Matt
   
-Original Message-
From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 7:58 AM
To: 'Struts Users Mailing List'
Subject: RE: db connection pool question


please look at the thread with subject Problem with JDBC 
   Struts 
Connection Pool (possible to recon nect?).  Matt Raible had a 
solution to that by setting autoReconnect=true

-Original Message-
From: david chan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 9:56 AM
To: Struts Users Mailing List
Subject: db connection pool question


Hi,
 I am using a connection pool from 
org.apache.commons.dbcp.BasicDataSourceFactory and the 
 driver is 
oracle.jdbc.driver.OracleDriver. It works great until if 
  the server 
idle for a few days, then the connection object seems 
 broken with 
this error:  begin error mesg ===
java.sql.SQLException: Io exception: Software caused
connection abort: socket wr
ite error   at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
  at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
  at

  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
   at

  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
   at

   
  
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
ment.java:182)   at

   
  
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
nection.java:602)at

   
  
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
.java:538)at
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
DelegatingConn
ection.java:197)
...
=  end of error mesg 

What happen and how can I prevent this?
Thanks.
David



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now. 
http://mailplus.yahoo.com

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

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

RE: db connection pool question [solved]

2003-01-23 Thread pqin
If you use oracle.jdbc.pool.OracleConnectionPoolDataSource, what will be the
url?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
Sent: January 23, 2003 11:53 AM
To: 'Struts Users Mailing List'
Cc: Immel, Richard
Subject: RE: db connection pool question [solved]

Using the following in my DBCP Connection Pool solved my problem:

parameter
namedriverClassName/name
valueoracle.jdbc.pool.OracleConnectionPoolDataSource/value
/parameter

However, for the JDBCRealm, I still have to use:

driverName=oracle.jdbc.driver.OracleDriver

Thanks,

Matt

 -Original Message-
 From: mech [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 12:10 PM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 I can't tell for Oracle, but for MySQL and the Struts Connection Pool
 you have to set some kind of autoReconnect=true for your connection
 url setup. Otherwise your connection pool will contain only stale
 connections after a certain timeout. 
 MySQL kicked me out after 8 hours of inactivity. 
 Without autoreconnect you will just pick a dead connection 
 out of this
 pool, get an exception, most likely even close the broken 
 connection in
 your finally-block and put it back into the pool. Next time you grab
 another dead connection and so on and forth.
 
 By the way... Are the certain pro and cons for the struts connection
 pool vs. the tomcat datasource connection pool?
 As far as I know the tomcat connection pool works only via jndi setup
 whereas struts utilized the oldfashioned way. And moreover 
 you have to
 set it up in struts-config.xml which is a bit tricky for deployment.
 
 Michael
 
  -Original Message-
  From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
  Sent: Mittwoch, 22. Januar 2003 17:18
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
  
  
  After waiting 24 hours, I'm still experiencing the same 
  problem with Oracle and a connection pool (DBCP) in Tomcat.  
  I guess I'll try configuring Oracle's connection pool??
  
  Matt
  
   -Original Message-
   From: Raible, Matt
   Sent: Tuesday, January 21, 2003 8:22 AM
   To: 'Struts Users Mailing List'
   Subject: RE: db connection pool question
   
   
   Actually, the solution that I had only works for MySQL.  I'm
   having the same problem with Oracle.  Funny - I just posted a 
   message to the commons-user group asking this same question.  
   I'll try adding the validationQuery parameter:
   
   parameter
  namevalidationQuery/name
  valueSELECT 'CRAP' FROM DUAL/value /parameter
   
   Thanks,
   
   Matt
   
-Original Message-
From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 7:58 AM
To: 'Struts Users Mailing List'
Subject: RE: db connection pool question


please look at the thread with subject Problem with JDBC 
   Struts 
Connection Pool (possible to recon nect?).  Matt Raible had a 
solution to that by setting autoReconnect=true

-Original Message-
From: david chan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 9:56 AM
To: Struts Users Mailing List
Subject: db connection pool question


Hi,
 I am using a connection pool from 
org.apache.commons.dbcp.BasicDataSourceFactory and the 
 driver is 
oracle.jdbc.driver.OracleDriver. It works great until if 
  the server 
idle for a few days, then the connection object seems 
 broken with 
this error:  begin error mesg ===
java.sql.SQLException: Io exception: Software caused
connection abort: socket wr
ite error   at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
  at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
  at

  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
   at

  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
   at

   
  
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
ment.java:182)   at

   
  
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
nection.java:602)at

   
  
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
.java:538)at
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
DelegatingConn
ection.java:197)
...
=  end of error mesg 

What happen and how can I prevent this?
Thanks.
David



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now. 
http://mailplus.yahoo.com

--
To unsubscribe, e-mail

RE: db connection pool question

2003-01-22 Thread Raible, Matt
After waiting 24 hours, I'm still experiencing the same problem with Oracle
and a connection pool (DBCP) in Tomcat.  I guess I'll try configuring
Oracle's connection pool??

Matt

 -Original Message-
 From: Raible, Matt 
 Sent: Tuesday, January 21, 2003 8:22 AM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 Actually, the solution that I had only works for MySQL.  I'm 
 having the same problem with Oracle.  Funny - I just posted a 
 message to the commons-user group asking this same question.  
 I'll try adding the validationQuery parameter:
 
 parameter
namevalidationQuery/name
valueSELECT 'CRAP' FROM DUAL/value
 /parameter
 
 Thanks,
 
 Matt
 
  -Original Message-
  From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 21, 2003 7:58 AM
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
  
  
  please look at the thread with subject Problem with JDBC  Struts
  Connection Pool (possible to recon nect?).  Matt Raible had 
  a solution to
  that by setting autoReconnect=true
  
  -Original Message-
  From: david chan [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 21, 2003 9:56 AM
  To: Struts Users Mailing List
  Subject: db connection pool question
  
  
  Hi,
   I am using a connection pool from
  org.apache.commons.dbcp.BasicDataSourceFactory and the
  driver is oracle.jdbc.driver.OracleDriver. It works
  great until if the server idle for a few days, then
  the connection object seems broken with this error:
   begin error mesg ===
  java.sql.SQLException: Io exception: Software caused
  connection abort: socket wr
  ite error   at
  oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at
  oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
  at
  oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
at
  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
 at
  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
 at
  
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
  ment.java:182)   at
  
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
  nection.java:602)at
  
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
  .java:538)at
  org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
  DelegatingConn
  ection.java:197)
  ...
  =  end of error mesg 
  
  What happen and how can I prevent this?
  Thanks.
  David
  
  
  
  __
  Do you Yahoo!?
  Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
  http://mailplus.yahoo.com
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  --
  To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]


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




RE: db connection pool question

2003-01-22 Thread Durham David Cntr 805CSS/SCBE
I have an example using the Connection Pooling that comes with the Oracle JDBC drivers.

It's rough, need to clean up logging and such, but the end result is  that 
OracleConnectionManager.getConnection(); returns a pooled connection and the 
connection props I have stored in WEB-INF/classes/db.properties, although I think you 
can put it anywhere in the classpath and it will be found.

Here's the properties file:

## For OracleConnectionManager
stmtCacheSize=100
driverType=thin
serverName=server
networkProtocol=tcp
databaseName=name
port=1521
user=user
password=password


Here's OracleConnectionManager.java  
(I'm probably infringing on a trademark here, so I'll just say that I'm not in any
way affiliated with Oracle and neither is this code.)


package dbutils;

import org.apache.log4j.helpers.Loader;
import java.sql.*;
import java.util.*;
import java.io.*;
import oracle.jdbc.pool.*;
import oracle.jdbc.driver.*;
import javax.sql.*;

/**
 *  Facilitates use of pooled oracle db connections.
 *  
 *  @author David Durham
 *
 */
public class OracleConnectionManager {

private static int stmtCacheSize = 100;
private static OracleConnectionPoolDataSource ocpds = null;
private static String connectString = null;
  private static String username = null;
  private static String password = null;

private OracleConnectionManager() {
//if (ocpds == null) {
createPool();
//}
}

private void createPool() {
try {
Properties dbinfo = new Properties();
InputStream in = new FileInputStream(new 
File(Loader.getResource(db.properties).getFile()));

dbinfo.load(in);
this.stmtCacheSize = 
Integer.parseInt(dbinfo.getProperty(stmtCacheSize));
  this.username = dbinfo.getProperty(user);
  this.password = dbinfo.getProperty(password);
  ocpds = new OracleConnectionPoolDataSource();
ocpds.setDriverType(dbinfo.getProperty(driverType));
ocpds.setServerName(dbinfo.getProperty(serverName));

ocpds.setNetworkProtocol(dbinfo.getProperty(networkProtocol));
ocpds.setDatabaseName(dbinfo.getProperty(databaseName));

ocpds.setPortNumber(Integer.parseInt(dbinfo.getProperty(port)));
ocpds.setUser(dbinfo.getProperty(user));
ocpds.setPassword(dbinfo.getProperty(password));
} catch (Exception e) { 
System.err.print(e.getMessage());
}
}


/**
 *  gets a connection from the connection pool
 *  @return a connection from the connection pool
 */
public static java.sql.Connection getConnection() throws SQLException 
if (ocpds == null) {
OracleConnectionManager ocm = new OracleConnectionManager();
}
PooledConnection pconn = null;
try {
pconn = ocpds.getPooledConnection();

((OraclePooledConnection)pconn).setStmtCacheSize(stmtCacheSize);
} catch ( Exception e ) { 
System.err.println(Connection attempt failed:  + 
e.getMessage());
}
return pconn.getConnection();

}
}



 -Original Message-
 From: Raible, Matt [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 10:18 AM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 After waiting 24 hours, I'm still experiencing the same 
 problem with Oracle
 and a connection pool (DBCP) in Tomcat.  I guess I'll try configuring
 Oracle's connection pool??
 
 Matt
 
  -Original Message-
  From: Raible, Matt 
  Sent: Tuesday, January 21, 2003 8:22 AM
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
  
  
  Actually, the solution that I had only works for MySQL.  I'm 
  having the same problem with Oracle.  Funny - I just posted a 
  message to the commons-user group asking this same question.  
  I'll try adding the validationQuery parameter:
  
  parameter
 namevalidationQuery/name
 valueSELECT 'CRAP' FROM DUAL/value
  /parameter
  
  Thanks,
  
  Matt
  
   -Original Message-
   From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 7:58 AM
   To: 'Struts Users Mailing List'
   Subject: RE: db connection pool question
   
   
   please look at the thread with subject Problem with JDBC  Struts
   Connection Pool (possible to recon nect?).  Matt Raible had 
   a solution to
   that by setting autoReconnect=true
   
   -Original Message-
   From: david chan [mailto:[EMAIL

RE: db connection pool question

2003-01-22 Thread mech
I can't tell for Oracle, but for MySQL and the Struts Connection Pool
you have to set some kind of autoReconnect=true for your connection
url setup. Otherwise your connection pool will contain only stale
connections after a certain timeout. 
MySQL kicked me out after 8 hours of inactivity. 
Without autoreconnect you will just pick a dead connection out of this
pool, get an exception, most likely even close the broken connection in
your finally-block and put it back into the pool. Next time you grab
another dead connection and so on and forth.

By the way... Are the certain pro and cons for the struts connection
pool vs. the tomcat datasource connection pool?
As far as I know the tomcat connection pool works only via jndi setup
whereas struts utilized the oldfashioned way. And moreover you have to
set it up in struts-config.xml which is a bit tricky for deployment.

Michael

 -Original Message-
 From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
 Sent: Mittwoch, 22. Januar 2003 17:18
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 After waiting 24 hours, I'm still experiencing the same 
 problem with Oracle and a connection pool (DBCP) in Tomcat.  
 I guess I'll try configuring Oracle's connection pool??
 
 Matt
 
  -Original Message-
  From: Raible, Matt
  Sent: Tuesday, January 21, 2003 8:22 AM
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
  
  
  Actually, the solution that I had only works for MySQL.  I'm
  having the same problem with Oracle.  Funny - I just posted a 
  message to the commons-user group asking this same question.  
  I'll try adding the validationQuery parameter:
  
  parameter
 namevalidationQuery/name
 valueSELECT 'CRAP' FROM DUAL/value /parameter
  
  Thanks,
  
  Matt
  
   -Original Message-
   From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 7:58 AM
   To: 'Struts Users Mailing List'
   Subject: RE: db connection pool question
   
   
   please look at the thread with subject Problem with JDBC 
  Struts 
   Connection Pool (possible to recon nect?).  Matt Raible had a 
   solution to that by setting autoReconnect=true
   
   -Original Message-
   From: david chan [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 9:56 AM
   To: Struts Users Mailing List
   Subject: db connection pool question
   
   
   Hi,
I am using a connection pool from 
   org.apache.commons.dbcp.BasicDataSourceFactory and the driver is 
   oracle.jdbc.driver.OracleDriver. It works great until if 
 the server 
   idle for a few days, then the connection object seems broken with 
   this error:  begin error mesg ===
   java.sql.SQLException: Io exception: Software caused
   connection abort: socket wr
   ite error   at
   oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
 at
   oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
   at
   oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
 at
   
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
  at
   
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
  at
   
  
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
   ment.java:182)   at
   
  
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
   nection.java:602)at
   
  
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
   .java:538)at
   org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
   DelegatingConn
   ection.java:197)
   ...
   =  end of error mesg 
   
   What happen and how can I prevent this?
   Thanks.
   David
   
   
   
   __
   Do you Yahoo!?
   Yahoo! Mail Plus - Powerful. Affordable. Sign up now. 
   http://mailplus.yahoo.com
   
   --
   To unsubscribe, e-mail: 
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail: 
   mailto:[EMAIL PROTECTED]
   
   --
   To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:   
 mailto:struts-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:[EMAIL PROTECTED]
 


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




RE: db connection pool question

2003-01-22 Thread David Graham
What is tricky about setting up a datasource in struts-config for 
deployment?  The advantage is that you don't need to worry about container 
specific datasource setup.

David






From: mech [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: db connection pool question
Date: Wed, 22 Jan 2003 20:09:55 +0100

I can't tell for Oracle, but for MySQL and the Struts Connection Pool
you have to set some kind of autoReconnect=true for your connection
url setup. Otherwise your connection pool will contain only stale
connections after a certain timeout.
MySQL kicked me out after 8 hours of inactivity.
Without autoreconnect you will just pick a dead connection out of this
pool, get an exception, most likely even close the broken connection in
your finally-block and put it back into the pool. Next time you grab
another dead connection and so on and forth.

By the way... Are the certain pro and cons for the struts connection
pool vs. the tomcat datasource connection pool?
As far as I know the tomcat connection pool works only via jndi setup
whereas struts utilized the oldfashioned way. And moreover you have to
set it up in struts-config.xml which is a bit tricky for deployment.

Michael

 -Original Message-
 From: Raible, Matt [mailto:[EMAIL PROTECTED]]
 Sent: Mittwoch, 22. Januar 2003 17:18
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question


 After waiting 24 hours, I'm still experiencing the same
 problem with Oracle and a connection pool (DBCP) in Tomcat.
 I guess I'll try configuring Oracle's connection pool??

 Matt

  -Original Message-
  From: Raible, Matt
  Sent: Tuesday, January 21, 2003 8:22 AM
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
 
 
  Actually, the solution that I had only works for MySQL.  I'm
  having the same problem with Oracle.  Funny - I just posted a
  message to the commons-user group asking this same question.
  I'll try adding the validationQuery parameter:
 
  parameter
 namevalidationQuery/name
 valueSELECT 'CRAP' FROM DUAL/value /parameter
 
  Thanks,
 
  Matt
 
   -Original Message-
   From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 7:58 AM
   To: 'Struts Users Mailing List'
   Subject: RE: db connection pool question
  
  
   please look at the thread with subject Problem with JDBC
  Struts
   Connection Pool (possible to recon nect?).  Matt Raible had a
   solution to that by setting autoReconnect=true
  
   -Original Message-
   From: david chan [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 9:56 AM
   To: Struts Users Mailing List
   Subject: db connection pool question
  
  
   Hi,
I am using a connection pool from
   org.apache.commons.dbcp.BasicDataSourceFactory and the driver is
   oracle.jdbc.driver.OracleDriver. It works great until if
 the server
   idle for a few days, then the connection object seems broken with
   this error:  begin error mesg ===
   java.sql.SQLException: Io exception: Software caused
   connection abort: socket wr
   ite error   at
   oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
 at
   oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
   at
   oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
 at
  
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
  at
  
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
  at
  
 
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
   ment.java:182)   at
  
 
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
   nection.java:602)at
  
 
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
   .java:538)at
   org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
   DelegatingConn
   ection.java:197)
   ...
   =  end of error mesg 
  
   What happen and how can I prevent this?
   Thanks.
   David
  
  
  
   __
   Do you Yahoo!?
   Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
   http://mailplus.yahoo.com
  
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


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



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


_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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

RE: db connection pool question

2003-01-22 Thread mech
It's not really conform to the idea that the deploying administrator
shouldn't have to touch the webapp to make it run. In case you want to
configure your .war packed webapp you would have to unpack, edit
struts-config.xml and so on.
One idea behind J2EE was write once, run everywhere, as long as you can
deploy it ;-)
And thus the deployment should be independent from the webapp internals.

So server.xml is the cleaner solution even if it won't make a big
difference in many cases.

Development must be non-container specific (specs), deployment is
container specific and shouldn't be webapp specific.

Michael

 -Original Message-
 From: David Graham [mailto:[EMAIL PROTECTED]] 
 Sent: Mittwoch, 22. Januar 2003 20:40
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: db connection pool question
 
 
 What is tricky about setting up a datasource in struts-config for 
 deployment?  The advantage is that you don't need to worry 
 about container 
 specific datasource setup.
 
 David
 
 
 
 
 
 
 From: mech [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: db connection pool question
 Date: Wed, 22 Jan 2003 20:09:55 +0100
 
 I can't tell for Oracle, but for MySQL and the Struts 
 Connection Pool 
 you have to set some kind of autoReconnect=true for your 
 connection 
 url setup. Otherwise your connection pool will contain only stale 
 connections after a certain timeout. MySQL kicked me out 
 after 8 hours 
 of inactivity. Without autoreconnect you will just pick a dead 
 connection out of this pool, get an exception, most likely 
 even close 
 the broken connection in your finally-block and put it back into the 
 pool. Next time you grab another dead connection and so on and forth.
 
 By the way... Are the certain pro and cons for the struts connection 
 pool vs. the tomcat datasource connection pool? As far as I know the 
 tomcat connection pool works only via jndi setup whereas struts 
 utilized the oldfashioned way. And moreover you have to 
 set it up in 
 struts-config.xml which is a bit tricky for deployment.
 
 Michael
 
   -Original Message-
   From: Raible, Matt [mailto:[EMAIL PROTECTED]]
   Sent: Mittwoch, 22. Januar 2003 17:18
   To: 'Struts Users Mailing List'
   Subject: RE: db connection pool question
  
  
   After waiting 24 hours, I'm still experiencing the same 
 problem with 
   Oracle and a connection pool (DBCP) in Tomcat. I guess I'll try 
   configuring Oracle's connection pool??
  
   Matt
  
-Original Message-
From: Raible, Matt
Sent: Tuesday, January 21, 2003 8:22 AM
To: 'Struts Users Mailing List'
Subject: RE: db connection pool question
   
   
Actually, the solution that I had only works for MySQL.  I'm 
having the same problem with Oracle.  Funny - I just posted a 
message to the commons-user group asking this same 
 question. I'll 
try adding the validationQuery parameter:
   
parameter
   namevalidationQuery/name
   valueSELECT 'CRAP' FROM DUAL/value /parameter
   
Thanks,
   
Matt
   
 -Original Message-
 From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 7:58 AM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question


 please look at the thread with subject Problem with JDBC
Struts
 Connection Pool (possible to recon nect?).  Matt 
 Raible had a 
 solution to that by setting autoReconnect=true

 -Original Message-
 From: david chan [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 9:56 AM
 To: Struts Users Mailing List
 Subject: db connection pool question


 Hi,
  I am using a connection pool from 
 org.apache.commons.dbcp.BasicDataSourceFactory and 
 the driver is 
 oracle.jdbc.driver.OracleDriver. It works great until if
   the server
 idle for a few days, then the connection object seems broken 
 with this error:  begin error mesg ===
 java.sql.SQLException: Io exception: Software caused 
 connection 
 abort: socket wr
 ite error   at
 
 oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
   at
 
 oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
 at
 
 oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
   at

   
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
at

   
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
at

   
   
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedStat
   e
 ment.java:182)   at

   
   
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCo
   n
 nection.java:602)at

   
   
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnectio
   n
 .java:538

RE: db connection pool question

2003-01-22 Thread Raible, Matt
Furthermore, Tomcat 4.1.x makes this even easier by allowing you to put a
context.xml file into the webapps directory, rather than putting a context
entry in servlet.xml.  This makes it even easier to setup your app on a new
server.  I have an ant task called setup-tomcat that copies my jdbc-driver
to $CATALINA_HOME/common/lib and my-app.xml to $CATALINA_HOME/webapps and
tomcat is ready to go!

Matt

 -Original Message-
 From: mech [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 1:33 PM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 It's not really conform to the idea that the deploying administrator
 shouldn't have to touch the webapp to make it run. In case you want to
 configure your .war packed webapp you would have to unpack, edit
 struts-config.xml and so on.
 One idea behind J2EE was write once, run everywhere, as long 
 as you can
 deploy it ;-)
 And thus the deployment should be independent from the webapp 
 internals.
 
 So server.xml is the cleaner solution even if it won't make a big
 difference in many cases.
 
 Development must be non-container specific (specs), deployment is
 container specific and shouldn't be webapp specific.
 
 Michael
 
  -Original Message-
  From: David Graham [mailto:[EMAIL PROTECTED]] 
  Sent: Mittwoch, 22. Januar 2003 20:40
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: RE: db connection pool question
  
  
  What is tricky about setting up a datasource in struts-config for 
  deployment?  The advantage is that you don't need to worry 
  about container 
  specific datasource setup.
  
  David
  
  
  
  
  
  
  From: mech [EMAIL PROTECTED]
  Reply-To: [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Subject: RE: db connection pool question
  Date: Wed, 22 Jan 2003 20:09:55 +0100
  
  I can't tell for Oracle, but for MySQL and the Struts 
  Connection Pool 
  you have to set some kind of autoReconnect=true for your 
  connection 
  url setup. Otherwise your connection pool will contain only stale 
  connections after a certain timeout. MySQL kicked me out 
  after 8 hours 
  of inactivity. Without autoreconnect you will just pick a dead 
  connection out of this pool, get an exception, most likely 
  even close 
  the broken connection in your finally-block and put it 
 back into the 
  pool. Next time you grab another dead connection and so on 
 and forth.
  
  By the way... Are the certain pro and cons for the struts 
 connection 
  pool vs. the tomcat datasource connection pool? As far as 
 I know the 
  tomcat connection pool works only via jndi setup whereas struts 
  utilized the oldfashioned way. And moreover you have to 
  set it up in 
  struts-config.xml which is a bit tricky for deployment.
  
  Michael
  
-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]]
Sent: Mittwoch, 22. Januar 2003 17:18
To: 'Struts Users Mailing List'
Subject: RE: db connection pool question
   
   
After waiting 24 hours, I'm still experiencing the same 
  problem with 
Oracle and a connection pool (DBCP) in Tomcat. I guess I'll try 
configuring Oracle's connection pool??
   
Matt
   
 -Original Message-
 From: Raible, Matt
 Sent: Tuesday, January 21, 2003 8:22 AM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question


 Actually, the solution that I had only works for MySQL.  I'm 
 having the same problem with Oracle.  Funny - I just posted a 
 message to the commons-user group asking this same 
  question. I'll 
 try adding the validationQuery parameter:

 parameter
namevalidationQuery/name
valueSELECT 'CRAP' FROM DUAL/value /parameter

 Thanks,

 Matt

  -Original Message-
  From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 21, 2003 7:58 AM
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
 
 
  please look at the thread with subject Problem with JDBC
 Struts
  Connection Pool (possible to recon nect?).  Matt 
  Raible had a 
  solution to that by setting autoReconnect=true
 
  -Original Message-
  From: david chan [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 21, 2003 9:56 AM
  To: Struts Users Mailing List
  Subject: db connection pool question
 
 
  Hi,
   I am using a connection pool from 
  org.apache.commons.dbcp.BasicDataSourceFactory and 
  the driver is 
  oracle.jdbc.driver.OracleDriver. It works great until if
the server
  idle for a few days, then the connection object 
 seems broken 
  with this error:  begin error mesg ===
  java.sql.SQLException: Io exception: Software caused 
  connection 
  abort: socket wr
  ite error   at
  
  oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168

db connection pool question

2003-01-21 Thread david chan
Hi,
 I am using a connection pool from
org.apache.commons.dbcp.BasicDataSourceFactory and the
driver is oracle.jdbc.driver.OracleDriver. It works
great until if the server idle for a few days, then
the connection object seems broken with this error:
 begin error mesg ===
java.sql.SQLException: Io exception: Software caused
connection abort: socket wr
ite error   at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
  at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
  at
oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
   at
oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
   at
oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
ment.java:182)   at
oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
nection.java:602)at
oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
.java:538)at
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:197)
...
=  end of error mesg 

What happen and how can I prevent this?
Thanks.
David



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: db connection pool question

2003-01-21 Thread Pani, Gourav
please look at the thread with subject Problem with JDBC  Struts
Connection Pool (possible to recon nect?).  Matt Raible had a solution to
that by setting autoReconnect=true

-Original Message-
From: david chan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 9:56 AM
To: Struts Users Mailing List
Subject: db connection pool question


Hi,
 I am using a connection pool from
org.apache.commons.dbcp.BasicDataSourceFactory and the
driver is oracle.jdbc.driver.OracleDriver. It works
great until if the server idle for a few days, then
the connection object seems broken with this error:
 begin error mesg ===
java.sql.SQLException: Io exception: Software caused
connection abort: socket wr
ite error   at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
  at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
  at
oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
   at
oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
   at
oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
ment.java:182)   at
oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
nection.java:602)at
oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
.java:538)at
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConn
ection.java:197)
...
=  end of error mesg 

What happen and how can I prevent this?
Thanks.
David



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

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




Re: db connection pool question

2003-01-21 Thread Rick Reumann
On Tuesday, January 21, 2003, 9:56:09 AM, david wrote:

dc Hi,  I am using a connection pool from
dc org.apache.commons.dbcp.BasicDataSourceFactory and the driver is
dc oracle.jdbc.driver.OracleDriver. It works great until if the
dc server idle for a few days, then the connection object seems
dc broken with this error:  begin error mesg ===
dc java.sql.SQLException: Io exception: Software caused connection
dc abort: socket wr ite error   at

I believe I had similar problems here as well but it usually only
happened when the DBA would for some reason decide to kill connections
that were open. I went with configuring the pooling with whatever
comes packaged with Tomcat and configuring it in the server.xml
making sure to add the extra overhead of performing a validation query

parameter
   namevalidationQuery/name
   valueSELECT 'CRAP' FROM DUAL/value
/parameter

Not sure what app server you are running but maybe somewhere you can
set up a similar parameter to make sure it is handing out a valid
connection from the pool. I'm pretty clueless when it comes to this
stuff and just followed some examples I saw. Until I added the above
validationQuery I believe I got similar errors to what you
experienced.

-- 

Rick
mailto:[EMAIL PROTECTED]


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




RE: db connection pool question

2003-01-21 Thread Raible, Matt
Actually, the solution that I had only works for MySQL.  I'm having the same
problem with Oracle.  Funny - I just posted a message to the commons-user
group asking this same question.  I'll try adding the validationQuery
parameter:

parameter
   namevalidationQuery/name
   valueSELECT 'CRAP' FROM DUAL/value
/parameter

Thanks,

Matt

 -Original Message-
 From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 7:58 AM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 please look at the thread with subject Problem with JDBC  Struts
 Connection Pool (possible to recon nect?).  Matt Raible had 
 a solution to
 that by setting autoReconnect=true
 
 -Original Message-
 From: david chan [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 9:56 AM
 To: Struts Users Mailing List
 Subject: db connection pool question
 
 
 Hi,
  I am using a connection pool from
 org.apache.commons.dbcp.BasicDataSourceFactory and the
 driver is oracle.jdbc.driver.OracleDriver. It works
 great until if the server idle for a few days, then
 the connection object seems broken with this error:
  begin error mesg ===
 java.sql.SQLException: Io exception: Software caused
 connection abort: socket wr
 ite error   at
 oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
   at
 oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
 at
 oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
   at
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
at
 oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
at
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
 ment.java:182)   at
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
 nection.java:602)at
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
 .java:538)at
 org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
 DelegatingConn
 ection.java:197)
 ...
 =  end of error mesg 
 
 What happen and how can I prevent this?
 Thanks.
 David
 
 
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


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




Re: db connection pool question

2003-01-21 Thread Bradley G Smith

select 1 from dual is the standard way to ping oracle for a valid
connection. I would also recommend using Oracle's connection pool. It will
do this in the background. We have several tomcat and struts applications
running for weeks without problems. Even with Oracle going off line for
maintenance.

I can supply and example struts configuration using Oracle's driver
connection pool driver. Or check the archives for this mailing list, as I
have posted it here. Search using my name or Oracle.

Brad



   
  
  Rick Reumann 
  
  maillist@reuman To:  Struts Users Mailing List 
[EMAIL PROTECTED] 
  n.net   cc:  david chan 
[EMAIL PROTECTED]  
   Subject: Re: db connection pool 
question  
  21-01-03 07:19   
  
  Please respond   
  
  to Struts Users 
  
  Mailing List
  
   
  
   
  




On Tuesday, January 21, 2003, 9:56:09 AM, david wrote:

dc Hi,  I am using a connection pool from
dc org.apache.commons.dbcp.BasicDataSourceFactory and the driver is
dc oracle.jdbc.driver.OracleDriver. It works great until if the
dc server idle for a few days, then the connection object seems
dc broken with this error:  begin error mesg ===
dc java.sql.SQLException: Io exception: Software caused connection
dc abort: socket wr ite error   at

I believe I had similar problems here as well but it usually only
happened when the DBA would for some reason decide to kill connections
that were open. I went with configuring the pooling with whatever
comes packaged with Tomcat and configuring it in the server.xml
making sure to add the extra overhead of performing a validation query

parameter
   namevalidationQuery/name
   valueSELECT 'CRAP' FROM DUAL/value
/parameter

Not sure what app server you are running but maybe somewhere you can
set up a similar parameter to make sure it is handing out a valid
connection from the pool. I'm pretty clueless when it comes to this
stuff and just followed some examples I saw. Until I added the above
validationQuery I believe I got similar errors to what you
experienced.

--

Rick
mailto:[EMAIL PROTECTED]


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







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




RE: db connection pool question

2003-01-21 Thread Raible, Matt
I'm assuming this will work for configuring a context in Tomcat as well?

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg51842.html

Thanks,

Matt


 -Original Message-
 From: Bradley G Smith [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 9:29 AM
 To: Struts Users Mailing List
 Cc: david chan; Struts Users Mailing List
 Subject: Re: db connection pool question
 
 
 
 select 1 from dual is the standard way to ping oracle for a valid
 connection. I would also recommend using Oracle's connection 
 pool. It will
 do this in the background. We have several tomcat and struts 
 applications
 running for weeks without problems. Even with Oracle going 
 off line for
 maintenance.
 
 I can supply and example struts configuration using Oracle's driver
 connection pool driver. Or check the archives for this 
 mailing list, as I
 have posted it here. Search using my name or Oracle.
 
 Brad
 
 
 
   

   Rick Reumann

   maillist@reuman To:  
 Struts Users Mailing List [EMAIL PROTECTED] 
   n.net   cc:  david 
 chan [EMAIL PROTECTED]  
Subject: Re: 
 db connection pool question  
   21-01-03 07:19  

   Please respond  

   to Struts Users

   Mailing List   

   

   

 
 
 
 
 On Tuesday, January 21, 2003, 9:56:09 AM, david wrote:
 
 dc Hi,  I am using a connection pool from
 dc org.apache.commons.dbcp.BasicDataSourceFactory and the driver is
 dc oracle.jdbc.driver.OracleDriver. It works great until if the
 dc server idle for a few days, then the connection object seems
 dc broken with this error:  begin error mesg ===
 dc java.sql.SQLException: Io exception: Software caused connection
 dc abort: socket wr ite error   at
 
 I believe I had similar problems here as well but it usually only
 happened when the DBA would for some reason decide to kill connections
 that were open. I went with configuring the pooling with whatever
 comes packaged with Tomcat and configuring it in the server.xml
 making sure to add the extra overhead of performing a validation query
 
 parameter
namevalidationQuery/name
valueSELECT 'CRAP' FROM DUAL/value
 /parameter
 
 Not sure what app server you are running but maybe somewhere you can
 set up a similar parameter to make sure it is handing out a valid
 connection from the pool. I'm pretty clueless when it comes to this
 stuff and just followed some examples I saw. Until I added the above
 validationQuery I believe I got similar errors to what you
 experienced.
 
 --
 
 Rick
 mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 
 
 
 
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


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




Re: db connection pool question

2003-01-21 Thread Mike Deegan
If select 1 from dual is the standard way to ping oracle

Is there a standard for MySQL ???
I have seen SELECT 1 + 1 used ?

Mike


- Original Message -
From: Bradley G Smith [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: david chan [EMAIL PROTECTED]; Struts Users Mailing List
[EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 9:29 AM
Subject: Re: db connection pool question



 select 1 from dual is the standard way to ping oracle for a valid
 connection. I would also recommend using Oracle's connection pool. It will
 do this in the background. We have several tomcat and struts applications
 running for weeks without problems. Even with Oracle going off line for
 maintenance.

 I can supply and example struts configuration using Oracle's driver
 connection pool driver. Or check the archives for this mailing list, as I
 have posted it here. Search using my name or Oracle.

 Brad




   Rick Reumann
   maillist@reuman To:  Struts Users
Mailing List [EMAIL PROTECTED]
   n.net   cc:  david chan
[EMAIL PROTECTED]
Subject: Re: db connection
pool question
   21-01-03 07:19
   Please respond
   to Struts Users
   Mailing List






 On Tuesday, January 21, 2003, 9:56:09 AM, david wrote:

 dc Hi,  I am using a connection pool from
 dc org.apache.commons.dbcp.BasicDataSourceFactory and the driver is
 dc oracle.jdbc.driver.OracleDriver. It works great until if the
 dc server idle for a few days, then the connection object seems
 dc broken with this error:  begin error mesg ===
 dc java.sql.SQLException: Io exception: Software caused connection
 dc abort: socket wr ite error   at

 I believe I had similar problems here as well but it usually only
 happened when the DBA would for some reason decide to kill connections
 that were open. I went with configuring the pooling with whatever
 comes packaged with Tomcat and configuring it in the server.xml
 making sure to add the extra overhead of performing a validation query

 parameter
namevalidationQuery/name
valueSELECT 'CRAP' FROM DUAL/value
 /parameter

 Not sure what app server you are running but maybe somewhere you can
 set up a similar parameter to make sure it is handing out a valid
 connection from the pool. I'm pretty clueless when it comes to this
 stuff and just followed some examples I saw. Until I added the above
 validationQuery I believe I got similar errors to what you
 experienced.

 --

 Rick
 mailto:[EMAIL PROTECTED]


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







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


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




RE: db connection pool question

2003-01-21 Thread Thorsten Schäfer
Hi,

 I can supply and example struts configuration using Oracle's driver
 connection pool driver. Or check the archives for this mailing list,
as I
 have posted it here. Search using my name or Oracle.

Could you please post the example? I tried to search in the mailing
lists but I'm getting the error message Text search not available for
this list.

Thanks in advance,

Thorsten


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




RE: db connection pool question

2003-01-21 Thread david chan
Can I configure the MAX_LIMIT, MIN_LIMIT or maxActive,
maxIdle property for Oracle datasource?
I look at the oracle817 JDBC API docs, there is only
one class OracleOCIConnectionPool with some
properties like these but not sure I can set them
within the data-sources element of my
Struts-config.xml?

David

--- Raible, Matt [EMAIL PROTECTED]
wrote:
 I'm assuming this will work for configuring a
 context in Tomcat as well?
 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg51842.html
 
 Thanks,
 
 Matt
 
 
  -Original Message-
  From: Bradley G Smith [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 21, 2003 9:29 AM
  To: Struts Users Mailing List
  Cc: david chan; Struts Users Mailing List
  Subject: Re: db connection pool question
  
  
  
  select 1 from dual is the standard way to ping
 oracle for a valid
  connection. I would also recommend using Oracle's
 connection 
  pool. It will
  do this in the background. We have several tomcat
 and struts 
  applications
  running for weeks without problems. Even with
 Oracle going 
  off line for
  maintenance.
  
  I can supply and example struts configuration
 using Oracle's driver
  connection pool driver. Or check the archives for
 this 
  mailing list, as I
  have posted it here. Search using my name or
 Oracle.
  
  Brad
  
  
  



 
Rick Reumann


 
maillist@reuman To:
  
  Struts Users Mailing List
 [EMAIL PROTECTED] 
n.net   cc:
  david 
  chan [EMAIL PROTECTED] 
 

 Subject: Re: 
  db connection pool question   
   
21-01-03 07:19  


 
Please respond  


 
to Struts Users


 
Mailing List   


 



 



 
  
  
  
  
  On Tuesday, January 21, 2003, 9:56:09 AM, david
 wrote:
  
  dc Hi,  I am using a connection pool from
  dc org.apache.commons.dbcp.BasicDataSourceFactory
 and the driver is
  dc oracle.jdbc.driver.OracleDriver. It works
 great until if the
  dc server idle for a few days, then the
 connection object seems
  dc broken with this error:  begin error mesg
 ===
  dc java.sql.SQLException: Io exception: Software
 caused connection
  dc abort: socket wr ite error   at
  
  I believe I had similar problems here as well but
 it usually only
  happened when the DBA would for some reason decide
 to kill connections
  that were open. I went with configuring the
 pooling with whatever
  comes packaged with Tomcat and configuring it in
 the server.xml
  making sure to add the extra overhead of
 performing a validation query
  
  parameter
 namevalidationQuery/name
 valueSELECT 'CRAP' FROM DUAL/value
  /parameter
  
  Not sure what app server you are running but maybe
 somewhere you can
  set up a similar parameter to make sure it is
 handing out a valid
  connection from the pool. I'm pretty clueless when
 it comes to this
  stuff and just followed some examples I saw. Until
 I added the above
  validationQuery I believe I got similar errors to
 what you
  experienced.
  
  --
  
  Rick
  mailto:[EMAIL PROTECTED]
  
  
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
  
  
  
  
  
  
  
  --
  To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: db connection pool question

2003-01-21 Thread Bradley G Smith

If the Oracle class has the getter and setter methods, then yes, you can
set these properties. Struts is very nice about conforming to JavaBean
standards. I seem to recall that there were a couple of properties in the
Oracle class that did not conform to JavaBean standards, but most did.

Brad



   
  
  david chan   
  
  david_tomcat@ya To:  Struts Users Mailing List 
[EMAIL PROTECTED]   
  hoo.com cc: 
  
   Subject: RE: db connection pool 
question  
  21-01-03 09:13   
  
  Please respond   
  
  to Struts Users 
  
  Mailing List
  
   
  
   
  




Can I configure the MAX_LIMIT, MIN_LIMIT or maxActive,
maxIdle property for Oracle datasource?
I look at the oracle817 JDBC API docs, there is only
one class OracleOCIConnectionPool with some
properties like these but not sure I can set them
within the data-sources element of my
Struts-config.xml?

David

--- Raible, Matt [EMAIL PROTECTED]
wrote:
 I'm assuming this will work for configuring a
 context in Tomcat as well?


http://www.mail-archive.com/struts-user@jakarta.apache.org/msg51842.html

 Thanks,

 Matt


  -Original Message-
  From: Bradley G Smith [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 21, 2003 9:29 AM
  To: Struts Users Mailing List
  Cc: david chan; Struts Users Mailing List
  Subject: Re: db connection pool question
 
 
 
  select 1 from dual is the standard way to ping
 oracle for a valid
  connection. I would also recommend using Oracle's
 connection
  pool. It will
  do this in the background. We have several tomcat
 and struts
  applications
  running for weeks without problems. Even with
 Oracle going
  off line for
  maintenance.
 
  I can supply and example struts configuration
 using Oracle's driver
  connection pool driver. Or check the archives for
 this
  mailing list, as I
  have posted it here. Search using my name or
 Oracle.
 
  Brad
 
 
 
 

 

Rick Reumann

 

maillist@reuman To:

  Struts Users Mailing List
 [EMAIL PROTECTED]
n.net   cc:
  david
  chan [EMAIL PROTECTED]

 
 Subject: Re:
  db connection pool question

21-01-03 07:19

 

Please respond

 

to Struts Users

 

Mailing List

 

 

 

 

 

 
 
 
 
  On Tuesday, January 21, 2003, 9:56:09 AM, david
 wrote:
 
  dc Hi,  I am using a connection pool from
  dc org.apache.commons.dbcp.BasicDataSourceFactory
 and the driver is
  dc oracle.jdbc.driver.OracleDriver. It works
 great until if the
  dc server idle for a few days, then the
 connection object seems
  dc broken with this error:  begin error mesg
 ===
  dc java.sql.SQLException: Io exception: Software
 caused connection
  dc abort: socket wr ite error   at
 
  I believe I had similar problems here as well but
 it usually only
  happened when the DBA would for some reason decide
 to kill connections
  that were open. I went with configuring the
 pooling with whatever
  comes packaged with Tomcat and configuring it in
 the server.xml
  making sure to add the extra overhead of
 performing a validation query
 
  parameter
 namevalidationQuery/name
 valueSELECT 'CRAP' FROM DUAL/value
  /parameter
 
  Not sure what app server you are running but maybe
 somewhere you can
  set up a similar parameter to make sure it is
 handing out a valid
  connection from the pool. I'm pretty clueless when
 it comes to this
  stuff and just followed some examples I saw. Until
 I added the above
  validationQuery I believe I got similar errors to
 what you
  experienced.
 
  --
 
  Rick
  mailto:[EMAIL PROTECTED]
 
 
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
 
 
 
 
 
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED

Re: db connection pool question

2003-01-21 Thread NoSect
  
tnsping sid/servicename 

...is the actual way you test for a valid connection. if you can do a select, you 
already have a connection.



select 1 from dual is the standard way to ping oracle for a valid

connection. I would also recommend using Oracle's connection pool. It will

do this in the background. We have several tomcat and struts applications

running for weeks without problems. Even with Oracle going off line for

maintenance.








-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


RE: db connection pool question

2003-01-21 Thread Bradley G Smith

My pleasure. Here is the relevant code in the struts-config.xml file:

data-sources
   data-source key=POLL_DATA_SOURCE
type
=oracle.jdbc.pool.OracleConnectionPoolDataSource
  set-property property=password
value=password /
  set-property property=user
value=userid /
  set-property property=description
value=Oracle DataSource w/ Connection Pool /
  set-property property=URL
value=jdbc:oracle:thin:@ip_or_hostname:1521:ddb
/
   /data-source
/data-sources

Be sure and set the port (1521) and pid (ddb) correctly.

Here is code from a plug-in that gets the reference to the datasource:

  //initialize data cache
  DataSource ds = (DataSource) servlet.getServletContext()

.getAttribute(DataKeys.DATABASE_KEY);

  if (ds == null){
 ServletException e = new ServletException(
Datasource from servletcontext returned null);
 log.error(Datasource is null., e);
 throw e;
  }

DATABASE_KEY is the same value as the key on the DataSource in
struts.config.xml (ie POLL_DATA_SOURCE for our application). The DataSource
is the standard JDBC datasource interface.


We put the Oracle driver file (classes12.zip renamed to oracle.jar) into
Tomcat's commons/lib directory.

Brad



   
   
  Thorsten Schäfer 
   
  Newsletter@ThorstenS To:  'Struts Users Mailing 
List'
  chaefer.de   [EMAIL PROTECTED]   
   
cc:
   
  21-01-03 09:13Subject: RE: db connection pool 
question  
  Please respond to
   
  Struts Users Mailing
   
  List
   
   
   
   
   




Hi,

 I can supply and example struts configuration using Oracle's driver
 connection pool driver. Or check the archives for this mailing list,
as I
 have posted it here. Search using my name or Oracle.

Could you please post the example? I tried to search in the mailing
lists but I'm getting the error message Text search not available for
this list.








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




RE: db connection pool question

2003-01-21 Thread Bradley G Smith

And, where i mention PID below, I meant SID (which is going away according
to Oracle).

Brad



   
  
  Bradley G   
  
  Smith   To:  Struts Users Mailing List 
[EMAIL PROTECTED] 
  [EMAIL PROTECTED] cc: 
  
  d.usSubject: RE: db connection pool 
question  
   
  
  21-01-03 09:34   
  
  Please respond   
  
  to Struts Users 
  
  Mailing List
  
   
  
   
  





My pleasure. Here is the relevant code in the struts-config.xml file:

data-sources
   data-source key=POLL_DATA_SOURCE
type
=oracle.jdbc.pool.OracleConnectionPoolDataSource
  set-property property=password
value=password /
  set-property property=user
value=userid /
  set-property property=description
value=Oracle DataSource w/ Connection Pool /
  set-property property=URL
value=jdbc:oracle:thin:@ip_or_hostname:1521:ddb
/
   /data-source
/data-sources

Be sure and set the port (1521) and pid (ddb) correctly.

Here is code from a plug-in that gets the reference to the datasource:

  //initialize data cache
  DataSource ds = (DataSource) servlet.getServletContext()

.getAttribute(DataKeys.DATABASE_KEY);

  if (ds == null){
 ServletException e = new ServletException(
Datasource from servletcontext returned null);
 log.error(Datasource is null., e);
 throw e;
  }

DATABASE_KEY is the same value as the key on the DataSource in
struts.config.xml (ie POLL_DATA_SOURCE for our application). The DataSource
is the standard JDBC datasource interface.


We put the Oracle driver file (classes12.zip renamed to oracle.jar) into
Tomcat's commons/lib directory.

Brad




  Thorsten Schäfer

  Newsletter@ThorstenS To:  'Struts Users
Mailing List'
  chaefer.de
[EMAIL PROTECTED]
cc:

  21-01-03 09:13Subject: RE: db
connection pool question
  Please respond to

  Struts Users Mailing

  List







Hi,

 I can supply and example struts configuration using Oracle's driver
 connection pool driver. Or check the archives for this mailing list,
as I
 have posted it here. Search using my name or Oracle.

Could you please post the example? I tried to search in the mailing
lists but I'm getting the error message Text search not available for
this list.








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







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




RE: db connection pool question

2003-01-21 Thread david chan
With the use data-sources in Struts-config.xml, How
can I get the data-source in my initServlet that will
be loaded during startup of tomcat (or websphere)? My
initServlet will do one time loading of some data from
Oracle database and store them into application scope
and shared by different session. There are a couple of
things need to be sure:

1) struts datasource should be setup first (does
setting servlet loading sequence in web.xml, i.e.
ActionServlet will load first, then is my initServlet
etc...)
2) how to get the datasource from initServlet?
3) In general, I would like to ask what's the better
pratice to do web application initialization when
using Struts framework. i.e. init datasource, log4j
etc... So that I don't need to customize config for
tomcat, webshpere etc..

(My current solution doesn't use data-source within
Struts-config.xml, and I don't like that because I
need to do some config in tomcat's server.xml which
make it depends on app. server)

Thanks.
David

--- Bradley G Smith [EMAIL PROTECTED] wrote:
 
 If the Oracle class has the getter and setter
 methods, then yes, you can
 set these properties. Struts is very nice about
 conforming to JavaBean
 standards. I seem to recall that there were a couple
 of properties in the
 Oracle class that did not conform to JavaBean
 standards, but most did.
 
 Brad
 
 
 
 
 

   david chan
 

   david_tomcat@ya To:  
Struts Users Mailing List
 [EMAIL PROTECTED]   
   hoo.com cc:  
 

   
 Subject: RE: db connection pool question
  
   21-01-03 09:13
 

   Please respond
 

   to Struts Users  
 

   Mailing List 
 

 
 

 
 

 
 
 
 
 Can I configure the MAX_LIMIT, MIN_LIMIT or
 maxActive,
 maxIdle property for Oracle datasource?
 I look at the oracle817 JDBC API docs, there is only
 one class OracleOCIConnectionPool with some
 properties like these but not sure I can set them
 within the data-sources element of my
 Struts-config.xml?
 
 David
 
 --- Raible, Matt [EMAIL PROTECTED]
 wrote:
  I'm assuming this will work for configuring a
  context in Tomcat as well?
 
 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg51842.html
 
  Thanks,
 
  Matt
 
 
   -Original Message-
   From: Bradley G Smith
 [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 9:29 AM
   To: Struts Users Mailing List
   Cc: david chan; Struts Users Mailing List
   Subject: Re: db connection pool question
  
  
  
   select 1 from dual is the standard way to
 ping
  oracle for a valid
   connection. I would also recommend using
 Oracle's
  connection
   pool. It will
   do this in the background. We have several
 tomcat
  and struts
   applications
   running for weeks without problems. Even with
  Oracle going
   off line for
   maintenance.
  
   I can supply and example struts configuration
  using Oracle's driver
   connection pool driver. Or check the archives
 for
  this
   mailing list, as I
   have posted it here. Search using my name or
  Oracle.
  
   Brad
  
  
  
  
 
  
 
 Rick Reumann
 
  
 
 maillist@reuman
 To:
 
   Struts Users Mailing List
  [EMAIL PROTECTED]
 n.net  
 cc:
   david
   chan [EMAIL PROTECTED]
 
  
  Subject: Re:
   db connection pool question
 
 21-01-03 07:19
 
  
 
 Please respond
 
  
 
 to Struts Users
 
  
 
 Mailing List
 
  
 
  
 
  
 
  
 
  
 
  
  
  
  
   On Tuesday, January 21, 2003, 9:56:09 AM, david
  wrote:
  
   dc Hi,  I am using a connection pool from
   dc
 org.apache.commons.dbcp.BasicDataSourceFactory
  and the driver is
   dc oracle.jdbc.driver.OracleDriver. It works
  great until if the
   dc server idle for a few days, then the
  connection object seems
   dc broken with this error:  begin error
 mesg
  ===
   dc java.sql.SQLException: Io exception:
 Software

RE: db connection pool question

2003-01-21 Thread Wendy Smoak
 3) In general, I would like to ask what's the better
 pratice to do web application initialization when
 using Struts framework. i.e. init datasource, log4j
 etc... So that I don't need to customize config for
 tomcat, webshpere etc..

I can't claim better as I haven't tried anything else, but I use a
ServletContextListener to put Maps into Application scope for use as the
contents of select lists.

I'm not sure if you would have access to struts-config at that point,
though.  I use a .properties file to determine what database to connect to,
and have the other info hard coded in the DAO class, although it can be
overridden in the properties file.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management



RE: db connection pool question

2003-01-21 Thread Bradley G Smith

I believe you can define data sources in server.xml for tomcat at least,
and make them available for multiple applications. But I have not done that
yet (using Oracle connection pool classes).

Brad



   
  
  david chan   
  
  david_tomcat@ya To:  Struts Users Mailing List 
[EMAIL PROTECTED]   
  hoo.com cc: 
  
   Subject: RE: db connection pool 
question  
  21-01-03 09:43   
  
  Please respond   
  
  to Struts Users 
  
  Mailing List
  
   
  
   
  




With the use data-sources in Struts-config.xml, How
can I get the data-source in my initServlet that will
be loaded during startup of tomcat (or websphere)? My
initServlet will do one time loading of some data from
Oracle database and store them into application scope
and shared by different session. There are a couple of
things need to be sure:

1) struts datasource should be setup first (does
setting servlet loading sequence in web.xml, i.e.
ActionServlet will load first, then is my initServlet
etc...)
2) how to get the datasource from initServlet?
3) In general, I would like to ask what's the better
pratice to do web application initialization when
using Struts framework. i.e. init datasource, log4j
etc... So that I don't need to customize config for
tomcat, webshpere etc..

(My current solution doesn't use data-source within
Struts-config.xml, and I don't like that because I
need to do some config in tomcat's server.xml which
make it depends on app. server)

Thanks.
David

--- Bradley G Smith [EMAIL PROTECTED] wrote:

 If the Oracle class has the getter and setter
 methods, then yes, you can
 set these properties. Struts is very nice about
 conforming to JavaBean
 standards. I seem to recall that there were a couple
 of properties in the
 Oracle class that did not conform to JavaBean
 standards, but most did.

 Brad






   david chan


   david_tomcat@ya To:
Struts Users Mailing List
 [EMAIL PROTECTED]
   hoo.com cc:



 Subject: RE: db connection pool question

   21-01-03 09:13


   Please respond


   to Struts Users


   Mailing List












 Can I configure the MAX_LIMIT, MIN_LIMIT or
 maxActive,
 maxIdle property for Oracle datasource?
 I look at the oracle817 JDBC API docs, there is only
 one class OracleOCIConnectionPool with some
 properties like these but not sure I can set them
 within the data-sources element of my
 Struts-config.xml?

 David

 --- Raible, Matt [EMAIL PROTECTED]
 wrote:
  I'm assuming this will work for configuring a
  context in Tomcat as well?
 
 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg51842.html
 
  Thanks,
 
  Matt
 
 
   -Original Message-
   From: Bradley G Smith
 [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 9:29 AM
   To: Struts Users Mailing List
   Cc: david chan; Struts Users Mailing List
   Subject: Re: db connection pool question
  
  
  
   select 1 from dual is the standard way to
 ping
  oracle for a valid
   connection. I would also recommend using
 Oracle's
  connection
   pool. It will
   do this in the background. We have several
 tomcat
  and struts
   applications
   running for weeks without problems. Even with
  Oracle going
   off line for
   maintenance.
  
   I can supply and example struts configuration
  using Oracle's driver
   connection pool driver. Or check the archives
 for
  this
   mailing list, as I
   have posted it here. Search using my name or
  Oracle.
  
   Brad
  
  
  
  
 
  
 
 Rick Reumann
 
  
 
 maillist@reuman
 To:
 
   Struts Users Mailing List
  [EMAIL PROTECTED]
 n.net
 cc:
   david
   chan [EMAIL PROTECTED]
 
  
  Subject: Re:
   db connection pool question
 
 21-01-03 07:19
 
  
 
 Please respond

Problem with JDBC Struts Connection Pool (possible to reconnect?)

2003-01-17 Thread mech
Hi,

I'm running Tomcat 4.1.18 on Solaris 9 with a local MySQL 3.23.54-max
(InnoDB) database on port 3307 using started with mysqld (not
safemysld...difference btw?).

After not using any connection over night for let's say 12 hours or
more, I get SQLExceptions next morning:

java.sql.SQLException: Communication link failure:
java.net.SocketException

In my application I use JDBC for Tomcats security realm feature and
form-based auth. When I try to login for the first time, I get this
error log (see below), but if I try to login twice the db connection
seems to get reset automatically. (A solution I could live with,
although I have now idea why the connection was cut while it should be
idle overnight)

Unfortunatelly my struts connection pool that I use in my application's
data access classes doesn't get reinitialized after such a
SocketException (see below). The only solution so far was to reload or
stop/start the webapp with the Tomcat manager. Bad solution

In my struts-config.xml I already have something to reconnect (see
below), but it obviously didn't do the trick with my
mysql-connector-java-2.0.14.jar J/Connector. I simply lost the
connection somehow...

Can anyone give my an hint what happens to my MySQL connections? I don't
seem to have a problem if I send a query from time to time, but if I
wait too long and do nothing, I'm cut off... :-(

In case there's no way to stop this, is there a solution how to tell my
application (a java code snippet would be great...) to reinitialize the
Struts connection pool when this exception is thrown. For Tomcat's
JDBCRealm it is done somehow, how can I reset the MySQL connection for
Struts? I think I could live with a reconnect on the second try for a
query.

Thanks you!
Michael



--

data-sources
data-source
set-property property=driverClass
value=com.mysql.jdbc.Driver/
set-property property=url
value=jdbc:mysql://localhost:3307/praksis/
set-property property=maxCount value=25/
set-property property=minCount value=5/
set-property property=user value=praksis/
set-property property=password
value=siskarp/
set-property property=autoReconnect
value=true/
set-property property=maxReconnects
value=3/
set-property property=initialTimeout
value=2/
set-property property=profileSql
value=true/
/data-source  
/data-sources


EXCEPTION from log file:

(first time to try a login and utilize the connection again after long
idle time)
2003-01-17 12:28:55 JDBCRealm[/praksis]: Exception performing
authentication
java.sql.SQLException: Communication link failure:
java.net.SocketException
at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.PreparedStatement.executeQuery(Unknown Source)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:480)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241
5)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174

FW: Problem with JDBC Struts Connection Pool (possible to reconnect?) : Solution/Fix: J/Connector kills unused connections after 8 hours

2003-01-17 Thread mech
You can ignore my last email or read through if you encounter similar
problems and need a fix.
I just found out from the MySQL J/Connector documentation that
connections are cut off after 8 hours of inactivity.


I have a servlet/application that works fine for a day, and then stops 
  working overnight.

  Resolution: 

  MySQL closes connections after 8 hours of inactivity. You either
  need to use a connection pool that handles stale connections or use
the 
  autoReconnect parameter (see USAGE AND INSTALLATION). [...]

  

I guess (from my bad experience) that the Struts connection pool can't
handle stale connections so I just added autoReconnect to my
struts-config.xml. I hope this fix keeps my webapp work overnight this
time... Tomcat's JDBCRealm seems to handle stale connections
automatically... 
Maybe this would be a nice to have thing for the Struts connection pool,
too?!

BTW: You cannot use set-property for those special properties like
autoReconnect or profileSql. They have to be in the connectionURL
like this (I tried it differently with profileSql but nothing happend
on stderr):

Use instead similar to:
set-property property=url
value=jdbc:mysql://localhost:3307/praksis?autoReconnect=trueamp;maxRec
onnects=5amp;initialTimeout=2amp;profileSql=true/

Thanks anyway.
Michael

-Original Message-
From: mech [mailto:[EMAIL PROTECTED]] 
Sent: Freitag, 17. Januar 2003 12:52
To: '[EMAIL PROTECTED]'
Subject: Problem with JDBC  Struts Connection Pool (possible to
reconnect?)


Hi,

I'm running Tomcat 4.1.18 on Solaris 9 with a local MySQL 3.23.54-max
(InnoDB) database on port 3307 using started with mysqld (not
safemysld...difference btw?).

After not using any connection over night for let's say 12 hours or
more, I get SQLExceptions next morning:

java.sql.SQLException: Communication link failure:
java.net.SocketException

In my application I use JDBC for Tomcats security realm feature and
form-based auth. When I try to login for the first time, I get this
error log (see below), but if I try to login twice the db connection
seems to get reset automatically. (A solution I could live with,
although I have now idea why the connection was cut while it should be
idle overnight)

Unfortunatelly my struts connection pool that I use in my application's
data access classes doesn't get reinitialized after such a
SocketException (see below). The only solution so far was to reload or
stop/start the webapp with the Tomcat manager. Bad solution

In my struts-config.xml I already have something to reconnect (see
below), but it obviously didn't do the trick with my
mysql-connector-java-2.0.14.jar J/Connector. I simply lost the
connection somehow...

Can anyone give my an hint what happens to my MySQL connections? I don't
seem to have a problem if I send a query from time to time, but if I
wait too long and do nothing, I'm cut off... :-(

In case there's no way to stop this, is there a solution how to tell my
application (a java code snippet would be great...) to reinitialize the
Struts connection pool when this exception is thrown. For Tomcat's
JDBCRealm it is done somehow, how can I reset the MySQL connection for
Struts? I think I could live with a reconnect on the second try for a
query.

Thanks you!
Michael



--

data-sources
data-source
set-property property=driverClass
value=com.mysql.jdbc.Driver/
set-property property=url
value=jdbc:mysql://localhost:3307/praksis/
set-property property=maxCount value=25/
set-property property=minCount value=5/
set-property property=user value=praksis/
set-property property=password
value=siskarp/
set-property property=autoReconnect
value=true/
set-property property=maxReconnects
value=3/
set-property property=initialTimeout
value=2/
set-property property=profileSql
value=true/
/data-source  
/data-sources


EXCEPTION from log file:

(first time to try a login and utilize the connection again after long
idle time) 2003-01-17 12:28:55 JDBCRealm[/praksis]: Exception performing
authentication
java.sql.SQLException: Communication link failure:
java.net.SocketException
at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.PreparedStatement.executeQuery(Unknown Source)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java

RE: Problem with JDBC Struts Connection Pool (possible torecon nect?)

2003-01-17 Thread Raible, Matt
Add autoReconnect=true to your connectionURL, as in:

 connectionURL=
jdbc:mysql://localhost/roller?autoReconnect=trueamp;user=rolleramp;passwo
rd=tiger

-Original Message-
From: mech [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 4:52 AM
To: [EMAIL PROTECTED]
Subject: Problem with JDBC  Struts Connection Pool (possible to
reconnect?)


Hi,

I'm running Tomcat 4.1.18 on Solaris 9 with a local MySQL 3.23.54-max
(InnoDB) database on port 3307 using started with mysqld (not
safemysld...difference btw?).

After not using any connection over night for let's say 12 hours or
more, I get SQLExceptions next morning:

java.sql.SQLException: Communication link failure:
java.net.SocketException

In my application I use JDBC for Tomcats security realm feature and
form-based auth. When I try to login for the first time, I get this
error log (see below), but if I try to login twice the db connection
seems to get reset automatically. (A solution I could live with,
although I have now idea why the connection was cut while it should be
idle overnight)

Unfortunatelly my struts connection pool that I use in my application's
data access classes doesn't get reinitialized after such a
SocketException (see below). The only solution so far was to reload or
stop/start the webapp with the Tomcat manager. Bad solution

In my struts-config.xml I already have something to reconnect (see
below), but it obviously didn't do the trick with my
mysql-connector-java-2.0.14.jar J/Connector. I simply lost the
connection somehow...

Can anyone give my an hint what happens to my MySQL connections? I don't
seem to have a problem if I send a query from time to time, but if I
wait too long and do nothing, I'm cut off... :-(

In case there's no way to stop this, is there a solution how to tell my
application (a java code snippet would be great...) to reinitialize the
Struts connection pool when this exception is thrown. For Tomcat's
JDBCRealm it is done somehow, how can I reset the MySQL connection for
Struts? I think I could live with a reconnect on the second try for a
query.

Thanks you!
Michael



--

data-sources
data-source
set-property property=driverClass
value=com.mysql.jdbc.Driver/
set-property property=url
value=jdbc:mysql://localhost:3307/praksis/
set-property property=maxCount value=25/
set-property property=minCount value=5/
set-property property=user value=praksis/
set-property property=password
value=siskarp/
set-property property=autoReconnect
value=true/
set-property property=maxReconnects
value=3/
set-property property=initialTimeout
value=2/
set-property property=profileSql
value=true/
/data-source  
/data-sources


EXCEPTION from log file:

(first time to try a login and utilize the connection again after long
idle time)
2003-01-17 12:28:55 JDBCRealm[/praksis]: Exception performing
authentication
java.sql.SQLException: Communication link failure:
java.net.SocketException
at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.PreparedStatement.executeQuery(Unknown Source)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:480)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241
5)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172

Re: struts 1.1-b2 connection Pool

2002-11-26 Thread Bradley G Smith

For what it is worth, I use several web applications with Oracle as the
backend database. The ping query that I have used for a long time (since
JDBC 1.0 days) with Oracle is select 1 from dual.

Brad



   
 
Craig R.  
 
McClanahan  To: Struts Users Mailing List 
 
craigmcc@apa[EMAIL PROTECTED]  
 
che.org cc:   
 
 Subject: Re: struts 1.1-b2 connection 
Pool 
25-11-02   
 
20:31  
 
Please 
 
respond to 
 
Struts Users  
 
Mailing List  
 
   
 
   
 






On Tue, 26 Nov 2002, Jithendra_Kengerichikkanna wrote:



The 1.1 version of GenericDataSource makes available the fact that
commons-dbcp supports a ping query that is executed before the
pool returns a Connection as a result of the getConnection() method.






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




struts 1.1-b2 connection Pool

2002-11-25 Thread Jithendra_Kengerichikkanna
Hi all,
We are using struts 1.1-b2 version. Pls somebody throw some light on
connection pool.
 1)connection pool in struts 1.1-b2 version is stable?
 2)If database is restarted, web application is to be restarted to avoid the
socket exceptions? If yes pls suggest some alternate solution to rectify.

Thanks  Regds,
Jithu
** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**

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




Re: struts 1.1-b2 connection Pool

2002-11-25 Thread Craig R. McClanahan


On Tue, 26 Nov 2002, Jithendra_Kengerichikkanna wrote:

 Date: Tue, 26 Nov 2002 08:33:10 +0530
 From: Jithendra_Kengerichikkanna [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: struts 1.1-b2 connection Pool

 Hi all,
 We are using struts 1.1-b2 version. Pls somebody throw some light on
 connection pool.
  1)connection pool in struts 1.1-b2 version is stable?

The connection pool in Struts 1.1-b2 uses common-dbcp under the covers,
which is the same connection pool as the one Tomcat 4.1 uses.  Even if
bugs show up here, you should in general be able to update to a newer
commons-dbcp.jar file without having to update an entire Struts release.

  2)If database is restarted, web application is to be restarted to avoid the
 socket exceptions? If yes pls suggest some alternate solution to rectify.


The 1.1 version of GenericDataSource makes available the fact that
commons-dbcp supports a ping query that is executed before the
pool returns a Connection as a result of the getConnection() method.  This
avoids almost all cases of problems due to the database itself being
recycled while the webapp is running.

See the Javadocs for more details.

 Thanks  Regds,
 Jithu

Craig


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




Re: [OT] WAS Connection Pool

2002-11-18 Thread Adolfo Miguelez
We have solved our problem with null suppport from IBM, as almost usually. 
They should be still asking NASA for help.

A pointer, just in case someone run in the same issue.

Connection returned by WAS pool implements 
com.ibm.ejs.cm.proxy.OracleConnectionProxy, which in turns extends from
com.ibm.ejs.cm.proxy.ConnectionProxy. ConnectionProxy class has a method 
getPhysicalConnection(), which returns a Connection extending from 
OracleConnection which performs nicely with connected components.

Hope it can be helpful for someone else,

regards and thanks,

Adolfo.


From: Kris Schneider [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 14:27:32 -0400

All you can do with WLS is define the driver class. You can't define a data
source class to replace the one it uses internally. As for creating and 
binding
an instance of OracleConnectionCacheImpl, here are the basic steps:

OracleConnectionPoolDataSource ds =
new OracleConnectionPoolDataSource();

OracleConnectionCacheImpl cache =
new OracleConnectionCacheImpl(ds);

Context ctx = new InitialContext();
ctx.bind(jdbc/myDS, cache);

Of course, you'll need to configure the ds and cache objects appropriately.
Once the cache object is bound, you should be able to do the usual:

DataSource myDS = (DataSource)ctx.lookup(jdbc/myDS);
Connection conn = myDS.getConnection();

The difference is that you'll really be handed back Oracle implementation
classes instead of the app server's.

Quoting Adolfo Miguelez [EMAIL PROTECTED]:

 Firsly, thanks for your response:

 Yeah, I knew the issue appears also for WL. I have seem the problem 
quite
 complained in the web, but no the solution.

 Probably I will need to write and read.

 My employer want to use a pool managed by WAS itself. Preferably WAS 
pool,
 but it seems not possible. Is it possible to configure a different pool 
for

 WAS? e.g. Oracle pool? Have you tried it for WL?

 Any pointer to some way to proceed would be kindly appreciated. 
Absolutely
 lost, how to bind the OracleConnectionCacheImpl to JNDI and configure 
it, if

 possible, to WAS.

 Adolfo.

 From: Kris Schneider [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: [OT] WAS Connection Pool
 Date: Tue, 15 Oct 2002 11:48:37 -0400
 
 If it works anything like WLS, you'll get an instance of a class that
 implements Connection, but it won't be an instance of OracleConnection.
 
 Adolfo, do you want to read or write the structs/arrays?
 
 For reading, you should be able to use java.sql.SQLData to generically
 handle
 data retrieval. For writing, you may have to couple a bit more closely
 with
 Oracle-specific classes. Oracle has a tool called JPublisher that can
 generate
 Java classes from SQL objects, collection types (e.g. varray), and 
PL/SQL
 packages. It might be worth checking out, but it may tie you directly 
to
 an
 Oracle-specific solution. That's not always a big issue, but just 
something

 to
 be aware of.
 
 Another option is to just create and configure an instance of
 OracleConnectionCacheImpl within your app, bind it as a JNDI resource, 
and

 just
 use that as your connection pool.
 
 Quoting David Graham [EMAIL PROTECTED]:
 
   What database driver class are you using?  It seems like you should 
be
 able
  
   to tell WAS to use the oracle db driver which would return
   OracleConnections.
  
   Dave
  
  
   From: Adolfo Miguelez [EMAIL PROTECTED]
   Reply-To: Struts Users Mailing List 
[EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Subject: RE: How to use datasource and db connection pooling in
 struts?
   Date: Tue, 15 Oct 2002 14:58:46 +
   
   
   Taking advantage of this thread. Has any of you had the experience 
of
 using
  
   a connection provided by the Websphere pool to handle connected
 components,
  
   i.e. Struct or ARRAY in Oracle.
   
   We are getting a ClassCastException since driver attempts to cast 
the
   connection to an OracleConnection, and WAS pool provided connection
 does
   not implement OracleConnection since is a connection provided by 
IBM
   classes. Any workaround? We are stuck with this issue.
   
   If you ask to IBM support they probably response you to use DB2 so 
not
   really helpful. Any experience?
   
   TIA,
   
   Adolfo.
   
   From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
   Reply-To: Struts Users Mailing List
 [EMAIL PROTECTED]
   To: 'Struts Users Mailing List' [EMAIL PROTECTED]
   Subject: RE: How to use datasource and db connection pooling in
 struts?
   Date: Tue, 15 Oct 2002 10:42:13 -0400
   
   you can use commons-dbcp ... see
   http://jakarta.apache.org/commons/dbcp.html
   
   ---
   - Nayan Hajratwala
   - Chikli Consulting LLC
   - http://www.chikli.com
   
   
   -Original Message-
   From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]
   Sent

RE: Connection Pool for EJBs

2002-11-05 Thread Zeltser, Mark
Andrew,

Read Chuck's chapter on EJB+Struts at
http://www.theserverside.com/resources/strutsreview.jsp

Mark.

-Original Message-
From: Andrew Lubalin [mailto:alubalin;csc.com]
Sent: Monday, November 04, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: Connection Pool for EJBs


I am planning on using EJBs for my business tier in my application.  If I
configure a datasource and create a connection pool using Struts, will this
pool be global?  Will it be container managed or should I create my
connection pool independent of Struts and use it conjunction with the
framework.  What is the best way when using EJBs?


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org


--
This message is intended only for the personal and confidential use of the designated 
recipient(s) named above.  If you are not the intended recipient of this message you 
are hereby notified that any review, dissemination, distribution or copying of this 
message is strictly prohibited.  This communication is for information purposes only 
and should not be regarded as an offer to sell or as a solicitation of an offer to buy 
any financial product, an official confirmation of any transaction, or as an official 
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or 
error-free.  Therefore, we do not represent that this information is complete or 
accurate and it should not be relied upon as such.  All information is subject to 
change without notice.



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: Connection Pool for EJBs

2002-11-05 Thread V. Cekvenich
Do not use EJB for persistence (EJB only for CORBA or other, but never 
persistence).
At minimum write a DAO layer so you can replace EJB with a rowSet or a 
commonsSQL based persistence, once you realize EJB problems.
See www.basebeans.com/bad.jsp, or search on EJB on Google. I find mostly 
new programers try EJB, but EJB can lead to major issues in development 
and worse ones in production.


.V
Struts Mentor
917 345 1445


Zeltser, Mark wrote:
Andrew,

Read Chuck's chapter on EJB+Struts at
http://www.theserverside.com/resources/strutsreview.jsp

Mark.

-Original Message-
From: Andrew Lubalin [mailto:alubalin;csc.com]
Sent: Monday, November 04, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: Connection Pool for EJBs


I am planning on using EJBs for my business tier in my application.  If I
configure a datasource and create a connection pool using Struts, will this
pool be global?  Will it be container managed or should I create my
connection pool independent of Struts and use it conjunction with the
framework.  What is the best way when using EJBs?


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org


--
This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.





--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Connection Pool for EJBs

2002-11-04 Thread Andrew Lubalin
I am planning on using EJBs for my business tier in my application.  If I
configure a datasource and create a connection pool using Struts, will this
pool be global?  Will it be container managed or should I create my
connection pool independent of Struts and use it conjunction with the
framework.  What is the best way when using EJBs?


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: Connection Pool for EJBs

2002-11-04 Thread Kevin . Bedell






If you use EJB's, the best approach is to allow the EJB container to manage
all your database connections and then access all data using Entiy Beans.

Here are some general rules of thumb I'd recommend:

 - EJBs fit with Struts Model components. Generally, they should only be
called from the Struts Action class.

 - If you have more than 1 (or maybe 2) EJBs to access from your Action
class, consider implementing a Stateless Session Bean (or even a non-EJB
helper class that is called from your Action class) to act as a façade
and simplify your Action class.

 - Entity Beans should be Coarse Grained to minimize the number of beans
created and to isolate the Action class from changes in the table structure
of the underlying database.

 - Use Value Objects and pass data to and from the EJB a bean at a time
rather than a property at a time.

 - Avoid using Stateful Session Beans. Instead use Stateless Session Beans
and maintain stateful information in Struts using the session context of
the Web container.

 - Use Stateful Session Beans only if you have transactions that span more
than one user request and you need the EJB container to manage committing
or rolling-back the transaction.

I go into a good bit more detail in my book Struts Kick Start - it has
sample code and build scripts as well and comes with a CD-ROM containing
JBoss and a bunch of other apps.

Respond back if you have more specific questions -

Kevin



---
Kevin Bedell
Author, Struts Kick Start
http://www.amazon.com/exec/obidos/tg/detail/-/0672324725/qid=1036445679/sr=1-1/ref=sr_1_1/002-7047256-5912803?v=glance








Andrew Lubalin [EMAIL PROTECTED] on 11/04/2002 04:08:40 PM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:[EMAIL PROTECTED]
cc: (bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:Connection Pool for EJBs


I am planning on using EJBs for my business tier in my application.  If I
configure a datasource and create a connection pool using Struts, will this
pool be global?  Will it be container managed or should I create my
connection pool independent of Struts and use it conjunction with the
framework.  What is the best way when using EJBs?


--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org







---
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: Connection Pool for EJBs

2002-11-04 Thread John Owen
It is a very good idea to implement a facade or business delegate that
interfaces with a session bean when dealing with entity beans. This makes
your system very agile and independent of any view you should choose to use
(jsp,swing,console,et al). This delegate can then be used to feed the struts
framework the information it needs to generate the view. Unless you are
specifically designing for a web front-end, maintaining stateful information
in the web session context may not be appropriate. I would strongly suggest
not putting code to access EJBs in your action classes.

John

- Original Message -
From: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, November 04, 2002 3:35 PM
Subject: Re: Connection Pool for EJBs








If you use EJB's, the best approach is to allow the EJB container to manage
all your database connections and then access all data using Entiy Beans.

Here are some general rules of thumb I'd recommend:

 - EJBs fit with Struts Model components. Generally, they should only be
called from the Struts Action class.

 - If you have more than 1 (or maybe 2) EJBs to access from your Action
class, consider implementing a Stateless Session Bean (or even a non-EJB
helper class that is called from your Action class) to act as a façade
and simplify your Action class.

 - Entity Beans should be Coarse Grained to minimize the number of beans
created and to isolate the Action class from changes in the table structure
of the underlying database.

 - Use Value Objects and pass data to and from the EJB a bean at a time
rather than a property at a time.

 - Avoid using Stateful Session Beans. Instead use Stateless Session Beans
and maintain stateful information in Struts using the session context of
the Web container.

 - Use Stateful Session Beans only if you have transactions that span more
than one user request and you need the EJB container to manage committing
or rolling-back the transaction.

I go into a good bit more detail in my book Struts Kick Start - it has
sample code and build scripts as well and comes with a CD-ROM containing
JBoss and a bunch of other apps.

Respond back if you have more specific questions -

Kevin



---
Kevin Bedell
Author, Struts Kick Start
http://www.amazon.com/exec/obidos/tg/detail/-/0672324725/qid=1036445679/sr=1
-1/ref=sr_1_1/002-7047256-5912803?v=glance








Andrew Lubalin [EMAIL PROTECTED] on 11/04/2002 04:08:40 PM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:[EMAIL PROTECTED]
cc: (bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:Connection Pool for EJBs


I am planning on using EJBs for my business tier in my application.  If I
configure a datasource and create a connection pool using Struts, will this
pool be global?  Will it be container managed or should I create my
connection pool independent of Struts and use it conjunction with the
framework.  What is the best way when using EJBs?


--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org







---
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---



--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: [OT] WAS Connection Pool

2002-10-16 Thread Adolfo Miguelez

Yes Craig, that one is the first idea, but you know about the partial 
suppport that IBM and BEA provide. Their policy is attempt to bring the 
customer to their own products rather than solving integration problems with 
other companies.

I asked just in case someone run in the same issue, but I agree it is not 
the right forum for it. However this forum is so dynamic that I thought it 
would be worth dropping a message.

Sorry anyway,

Adolfo.

From: Craig R. McClanahan [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 09:45:06 -0700 (PDT)



On Tue, 15 Oct 2002, Adolfo Miguelez wrote:

  Date: Tue, 15 Oct 2002 16:21:24 +
  From: Adolfo Miguelez [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Re: [OT] WAS Connection Pool
 
  Firsly, thanks for your response:
 
  Yeah, I knew the issue appears also for WL. I have seem the problem 
quite
  complained in the web, but no the solution.
 
  Probably I will need to write and read.
 
  My employer want to use a pool managed by WAS itself. Preferably WAS 
pool,
  but it seems not possible. Is it possible to configure a different pool 
for
  WAS? e.g. Oracle pool? Have you tried it for WL?
 
  Any pointer to some way to proceed would be kindly appreciated. 
Absolutely
  lost, how to bind the OracleConnectionCacheImpl to JNDI and configure 
it, if
  possible, to WAS.
 

Anything like this would have to be documented by Oracle and BEA - you
might try reviewing their documentation, and/or asking their technical
support folks for help.

  Adolfo.

Craig


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


_
Broadband? Dial-up? Get reliable MSN Internet Access. 
http://resourcecenter.msn.com/access/plans/default.asp


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




Re: [OT] WAS Connection Pool

2002-10-15 Thread Kris Schneider

All you can do with WLS is define the driver class. You can't define a data 
source class to replace the one it uses internally. As for creating and binding 
an instance of OracleConnectionCacheImpl, here are the basic steps:

OracleConnectionPoolDataSource ds =
new OracleConnectionPoolDataSource();

OracleConnectionCacheImpl cache =
new OracleConnectionCacheImpl(ds);

Context ctx = new InitialContext();
ctx.bind(jdbc/myDS, cache);

Of course, you'll need to configure the ds and cache objects appropriately. 
Once the cache object is bound, you should be able to do the usual:

DataSource myDS = (DataSource)ctx.lookup(jdbc/myDS);
Connection conn = myDS.getConnection();

The difference is that you'll really be handed back Oracle implementation 
classes instead of the app server's.

Quoting Adolfo Miguelez [EMAIL PROTECTED]:

 Firsly, thanks for your response:
 
 Yeah, I knew the issue appears also for WL. I have seem the problem quite 
 complained in the web, but no the solution.
 
 Probably I will need to write and read.
 
 My employer want to use a pool managed by WAS itself. Preferably WAS pool, 
 but it seems not possible. Is it possible to configure a different pool for
 
 WAS? e.g. Oracle pool? Have you tried it for WL?
 
 Any pointer to some way to proceed would be kindly appreciated. Absolutely 
 lost, how to bind the OracleConnectionCacheImpl to JNDI and configure it, if
 
 possible, to WAS.
 
 Adolfo.
 
 From: Kris Schneider [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: [OT] WAS Connection Pool
 Date: Tue, 15 Oct 2002 11:48:37 -0400
 
 If it works anything like WLS, you'll get an instance of a class that
 implements Connection, but it won't be an instance of OracleConnection.
 
 Adolfo, do you want to read or write the structs/arrays?
 
 For reading, you should be able to use java.sql.SQLData to generically 
 handle
 data retrieval. For writing, you may have to couple a bit more closely
 with
 Oracle-specific classes. Oracle has a tool called JPublisher that can 
 generate
 Java classes from SQL objects, collection types (e.g. varray), and PL/SQL
 packages. It might be worth checking out, but it may tie you directly to
 an
 Oracle-specific solution. That's not always a big issue, but just something
 
 to
 be aware of.
 
 Another option is to just create and configure an instance of
 OracleConnectionCacheImpl within your app, bind it as a JNDI resource, and
 
 just
 use that as your connection pool.
 
 Quoting David Graham [EMAIL PROTECTED]:
 
   What database driver class are you using?  It seems like you should be 
 able
  
   to tell WAS to use the oracle db driver which would return
   OracleConnections.
  
   Dave
  
  
   From: Adolfo Miguelez [EMAIL PROTECTED]
   Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Subject: RE: How to use datasource and db connection pooling in
 struts?
   Date: Tue, 15 Oct 2002 14:58:46 +
   
   
   Taking advantage of this thread. Has any of you had the experience of 
 using
  
   a connection provided by the Websphere pool to handle connected 
 components,
  
   i.e. Struct or ARRAY in Oracle.
   
   We are getting a ClassCastException since driver attempts to cast the
   connection to an OracleConnection, and WAS pool provided connection 
 does
   not implement OracleConnection since is a connection provided by IBM
   classes. Any workaround? We are stuck with this issue.
   
   If you ask to IBM support they probably response you to use DB2 so not
   really helpful. Any experience?
   
   TIA,
   
   Adolfo.
   
   From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
   Reply-To: Struts Users Mailing List
 [EMAIL PROTECTED]
   To: 'Struts Users Mailing List' [EMAIL PROTECTED]
   Subject: RE: How to use datasource and db connection pooling in 
 struts?
   Date: Tue, 15 Oct 2002 10:42:13 -0400
   
   you can use commons-dbcp ... see
   http://jakarta.apache.org/commons/dbcp.html
   
   ---
   - Nayan Hajratwala
   - Chikli Consulting LLC
   - http://www.chikli.com
   
   
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, October 15, 2002 10:40 AM
   To: [EMAIL PROTECTED]
   Subject: How to use datasource and db connection pooling in struts?
   
   
   Hi, there!
   
   How can I easily achieve database connection pooling (using a 
 datasource
   in one of the xml config files - btw. which one is it?)?
   I know there is some stuff in jakarta-commons.
   What I want to achieve is an easy to configure and highly efficient
 db
   connection pool that is available to all my action classes.
   
   Stef.
   
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
   
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED

[OT] WAS Connection Pool

2002-10-15 Thread David Graham

What database driver class are you using?  It seems like you should be able 
to tell WAS to use the oracle db driver which would return 
OracleConnections.

Dave


From: Adolfo Miguelez [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 14:58:46 +


Taking advantage of this thread. Has any of you had the experience of using 
a connection provided by the Websphere pool to handle connected components, 
i.e. Struct or ARRAY in Oracle.

We are getting a ClassCastException since driver attempts to cast the 
connection to an OracleConnection, and WAS pool provided connection does 
not implement OracleConnection since is a connection provided by IBM 
classes. Any workaround? We are stuck with this issue.

If you ask to IBM support they probably response you to use DB2 so not 
really helpful. Any experience?

TIA,

Adolfo.

From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 10:42:13 -0400

you can use commons-dbcp ... see 
http://jakarta.apache.org/commons/dbcp.html

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 10:40 AM
To: [EMAIL PROTECTED]
Subject: How to use datasource and db connection pooling in struts?


Hi, there!

How can I easily achieve database connection pooling (using a datasource
in one of the xml config files - btw. which one is it?)?
I know there is some stuff in jakarta-commons.
What I want to achieve is an easy to configure and highly efficient db
connection pool that is available to all my action classes.

Stef.

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

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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: [OT] WAS Connection Pool

2002-10-15 Thread Adolfo Miguelez


Thin classes12.zip.

Perhaps you are right. Do you know how to do it? I do not want to use the 
DriverManager directly since it does not uses pooled connections (AFAIK?). 
Maybe telling WAS to use an Oracle pool rather tha WAS pool. Anyone know 
how?

Adolfo.

From: David Graham [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 09:02:29 -0600

What database driver class are you using?  It seems like you should be able 
to tell WAS to use the oracle db driver which would return 
OracleConnections.

Dave


From: Adolfo Miguelez [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 14:58:46 +


Taking advantage of this thread. Has any of you had the experience of 
using a connection provided by the Websphere pool to handle connected 
components, i.e. Struct or ARRAY in Oracle.

We are getting a ClassCastException since driver attempts to cast the 
connection to an OracleConnection, and WAS pool provided connection does 
not implement OracleConnection since is a connection provided by IBM 
classes. Any workaround? We are stuck with this issue.

If you ask to IBM support they probably response you to use DB2 so not 
really helpful. Any experience?

TIA,

Adolfo.

From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 10:42:13 -0400

you can use commons-dbcp ... see 
http://jakarta.apache.org/commons/dbcp.html

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 10:40 AM
To: [EMAIL PROTECTED]
Subject: How to use datasource and db connection pooling in struts?


Hi, there!

How can I easily achieve database connection pooling (using a datasource
in one of the xml config files - btw. which one is it?)?
I know there is some stuff in jakarta-commons.
What I want to achieve is an easy to configure and highly efficient db
connection pool that is available to all my action classes.

Stef.

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

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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




HTML
  HEAD
 TITLEAdolfo's signature/TITLE
  /HEAD
  BODY
 centerbemAdolfo Rodriguez Miguelez/emb/center

  /BODY
  /HTML





_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: [OT] WAS Connection Pool

2002-10-15 Thread Stefan.Landro

I think there is support for jdbc 2.0 in Oracle 9i - including pooling

-Original Message-
From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]] 
Sent: Dienstag, 15. Oktober 2002 17:23
To: [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool


Thin classes12.zip.

Perhaps you are right. Do you know how to do it? I do not want to use
the 
DriverManager directly since it does not uses pooled connections
(AFAIK?). 
Maybe telling WAS to use an Oracle pool rather tha WAS pool. Anyone know

how?

Adolfo.

From: David Graham [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 09:02:29 -0600

What database driver class are you using?  It seems like you should be
able 
to tell WAS to use the oracle db driver which would return 
OracleConnections.

Dave


From: Adolfo Miguelez [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in
struts?
Date: Tue, 15 Oct 2002 14:58:46 +


Taking advantage of this thread. Has any of you had the experience of 
using a connection provided by the Websphere pool to handle connected 
components, i.e. Struct or ARRAY in Oracle.

We are getting a ClassCastException since driver attempts to cast the 
connection to an OracleConnection, and WAS pool provided connection
does 
not implement OracleConnection since is a connection provided by IBM 
classes. Any workaround? We are stuck with this issue.

If you ask to IBM support they probably response you to use DB2 so not

really helpful. Any experience?

TIA,

Adolfo.

From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List
[EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in
struts?
Date: Tue, 15 Oct 2002 10:42:13 -0400

you can use commons-dbcp ... see 
http://jakarta.apache.org/commons/dbcp.html

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 10:40 AM
To: [EMAIL PROTECTED]
Subject: How to use datasource and db connection pooling in struts?


Hi, there!

How can I easily achieve database connection pooling (using a
datasource
in one of the xml config files - btw. which one is it?)?
I know there is some stuff in jakarta-commons.
What I want to achieve is an easy to configure and highly efficient
db
connection pool that is available to all my action classes.

Stef.

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

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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




HTML
  HEAD
 TITLEAdolfo's signature/TITLE
  /HEAD
  BODY
 centerbemAdolfo Rodriguez Miguelez/emb/center

  /BODY
  /HTML





_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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


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




Re: [OT] WAS Connection Pool

2002-10-15 Thread David Graham

I'm not familiar with the WAS pool but I thought that connection pooling was 
accomplished via the DataSource interface.  Implementations of DataSource 
can pool the Connections returned from getConnection.  The DataSource 
implementation should also be able to handle any kind of Connection 
(OracleConnection, DB2Connection).

Maybe the WAS DataSource or pool is only using DB2Connections but I highly 
doubt that.  I hope you are able to tell the WAS pool to use 
OracleConnection.

BTW, why do you need to cast to the specific connection type?

Dave


From: Adolfo Miguelez [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 15:23:13 +


Thin classes12.zip.

Perhaps you are right. Do you know how to do it? I do not want to use the 
DriverManager directly since it does not uses pooled connections (AFAIK?). 
Maybe telling WAS to use an Oracle pool rather tha WAS pool. Anyone know 
how?

Adolfo.

From: David Graham [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 09:02:29 -0600

What database driver class are you using?  It seems like you should be 
able to tell WAS to use the oracle db driver which would return 
OracleConnections.

Dave


From: Adolfo Miguelez [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 14:58:46 +


Taking advantage of this thread. Has any of you had the experience of 
using a connection provided by the Websphere pool to handle connected 
components, i.e. Struct or ARRAY in Oracle.

We are getting a ClassCastException since driver attempts to cast the 
connection to an OracleConnection, and WAS pool provided connection does 
not implement OracleConnection since is a connection provided by IBM 
classes. Any workaround? We are stuck with this issue.

If you ask to IBM support they probably response you to use DB2 so not 
really helpful. Any experience?

TIA,

Adolfo.

From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 10:42:13 -0400

you can use commons-dbcp ... see 
http://jakarta.apache.org/commons/dbcp.html

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 10:40 AM
To: [EMAIL PROTECTED]
Subject: How to use datasource and db connection pooling in struts?


Hi, there!

How can I easily achieve database connection pooling (using a datasource
in one of the xml config files - btw. which one is it?)?
I know there is some stuff in jakarta-commons.
What I want to achieve is an easy to configure and highly efficient db
connection pool that is available to all my action classes.

Stef.

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

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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




HTML
  HEAD
 TITLEAdolfo's signature/TITLE
  /HEAD
  BODY
 centerbemAdolfo Rodriguez Miguelez/emb/center

  /BODY
  /HTML





_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [OT] WAS Connection Pool

2002-10-15 Thread Kris Schneider

If it works anything like WLS, you'll get an instance of a class that 
implements Connection, but it won't be an instance of OracleConnection.

Adolfo, do you want to read or write the structs/arrays?

For reading, you should be able to use java.sql.SQLData to generically handle 
data retrieval. For writing, you may have to couple a bit more closely with 
Oracle-specific classes. Oracle has a tool called JPublisher that can generate 
Java classes from SQL objects, collection types (e.g. varray), and PL/SQL 
packages. It might be worth checking out, but it may tie you directly to an 
Oracle-specific solution. That's not always a big issue, but just something to 
be aware of.

Another option is to just create and configure an instance of 
OracleConnectionCacheImpl within your app, bind it as a JNDI resource, and just 
use that as your connection pool.

Quoting David Graham [EMAIL PROTECTED]:

 What database driver class are you using?  It seems like you should be able
 
 to tell WAS to use the oracle db driver which would return 
 OracleConnections.
 
 Dave
 
 
 From: Adolfo Miguelez [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: RE: How to use datasource and db connection pooling in struts?
 Date: Tue, 15 Oct 2002 14:58:46 +
 
 
 Taking advantage of this thread. Has any of you had the experience of using
 
 a connection provided by the Websphere pool to handle connected components,
 
 i.e. Struct or ARRAY in Oracle.
 
 We are getting a ClassCastException since driver attempts to cast the 
 connection to an OracleConnection, and WAS pool provided connection does 
 not implement OracleConnection since is a connection provided by IBM 
 classes. Any workaround? We are stuck with this issue.
 
 If you ask to IBM support they probably response you to use DB2 so not 
 really helpful. Any experience?
 
 TIA,
 
 Adolfo.
 
 From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: How to use datasource and db connection pooling in struts?
 Date: Tue, 15 Oct 2002 10:42:13 -0400
 
 you can use commons-dbcp ... see 
 http://jakarta.apache.org/commons/dbcp.html
 
 ---
 - Nayan Hajratwala
 - Chikli Consulting LLC
 - http://www.chikli.com
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 15, 2002 10:40 AM
 To: [EMAIL PROTECTED]
 Subject: How to use datasource and db connection pooling in struts?
 
 
 Hi, there!
 
 How can I easily achieve database connection pooling (using a datasource
 in one of the xml config files - btw. which one is it?)?
 I know there is some stuff in jakarta-commons.
 What I want to achieve is an easy to configure and highly efficient db
 connection pool that is available to all my action classes.
 
 Stef.
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 
 
 
 _
 MSN Photos is the easiest way to share and print your photos: 
 http://photos.msn.com/support/worldwide.aspx
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 
 
 
 _
 MSN Photos is the easiest way to share and print your photos: 
 http://photos.msn.com/support/worldwide.aspx
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 


-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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




Re: [OT] WAS Connection Pool

2002-10-15 Thread Adolfo Miguelez

The point is that WAS pool returns a connection extending IBM classes and 
NOT OracleConnection. I use this connection with driver, but THE DRIVER, 
despite it gets a Connection argument in one of its methods (I do not 
remember which one), IT MAKES A CAST itself to OracleConnection.

As a consequence, all the connections that does implement OracleConnection 
(but yes Connection, of course) would throw a ClassCastException. It 
happends also with Weblogic as some friend pointed.

I do not know any nice workaround for the moment. The only one, quite ugly, 
getting a empty Struct element, fill it and update its data. A Struct 
returned by Oracle, is a connected component which connection is actually an 
OracleConnection, so it would not throw exception in the driver classes.

It seems that IBM implements their pool in WAS so the connections can not be 
used with Oracle connected components. A smart movement to tell you: move to 
DB2!!!

BTW, why do you need to cast to the specific connection type?

DRIVER MAKES THE CAST, despite there is a Connection in the method 
interface, but inside the method body, they cast it to OracleConnection. Not 
really nice.

Adolfo.


From: David Graham [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 09:34:05 -0600

I'm not familiar with the WAS pool but I thought that connection pooling 
was accomplished via the DataSource interface.  Implementations of 
DataSource can pool the Connections returned from getConnection.  The 
DataSource implementation should also be able to handle any kind of 
Connection (OracleConnection, DB2Connection).

Maybe the WAS DataSource or pool is only using DB2Connections but I highly 
doubt that.  I hope you are able to tell the WAS pool to use 
OracleConnection.

BTW, why do you need to cast to the specific connection type?

Dave


From: Adolfo Miguelez [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 15:23:13 +


Thin classes12.zip.

Perhaps you are right. Do you know how to do it? I do not want to use the 
DriverManager directly since it does not uses pooled connections (AFAIK?). 
Maybe telling WAS to use an Oracle pool rather tha WAS pool. Anyone know 
how?

Adolfo.

From: David Graham [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 09:02:29 -0600

What database driver class are you using?  It seems like you should be 
able to tell WAS to use the oracle db driver which would return 
OracleConnections.

Dave


From: Adolfo Miguelez [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 14:58:46 +


Taking advantage of this thread. Has any of you had the experience of 
using a connection provided by the Websphere pool to handle connected 
components, i.e. Struct or ARRAY in Oracle.

We are getting a ClassCastException since driver attempts to cast the 
connection to an OracleConnection, and WAS pool provided connection does 
not implement OracleConnection since is a connection provided by IBM 
classes. Any workaround? We are stuck with this issue.

If you ask to IBM support they probably response you to use DB2 so not 
really helpful. Any experience?

TIA,

Adolfo.

From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 10:42:13 -0400

you can use commons-dbcp ... see 
http://jakarta.apache.org/commons/dbcp.html

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 10:40 AM
To: [EMAIL PROTECTED]
Subject: How to use datasource and db connection pooling in struts?


Hi, there!

How can I easily achieve database connection pooling (using a 
datasource
in one of the xml config files - btw. which one is it?)?
I know there is some stuff in jakarta-commons.
What I want to achieve is an easy to configure and highly efficient db
connection pool that is available to all my action classes.

Stef.

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

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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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

RE: [OT] WAS Connection Pool

2002-10-15 Thread Adolfo Miguelez

All  examples comes for not pooled connections from DriverManager, maybe 
some of them could come from an Oracle pool, but quite sure that none uses a 
WAS pool.

Unfortunately, AFAIK, this is very important issue since driver supposes to 
use OracleConnection implementation and IBM's differs.

Adolfo

From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 17:25:40 +0200

I think there is support for jdbc 2.0 in Oracle 9i - including pooling

-Original Message-
From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
Sent: Dienstag, 15. Oktober 2002 17:23
To: [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool


Thin classes12.zip.

Perhaps you are right. Do you know how to do it? I do not want to use
the
DriverManager directly since it does not uses pooled connections
(AFAIK?).
Maybe telling WAS to use an Oracle pool rather tha WAS pool. Anyone know

how?

Adolfo.

 From: David Graham [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [OT] WAS Connection Pool
 Date: Tue, 15 Oct 2002 09:02:29 -0600
 
 What database driver class are you using?  It seems like you should be
able
 to tell WAS to use the oracle db driver which would return
 OracleConnections.
 
 Dave
 
 
 From: Adolfo Miguelez [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: RE: How to use datasource and db connection pooling in
struts?
 Date: Tue, 15 Oct 2002 14:58:46 +
 
 
 Taking advantage of this thread. Has any of you had the experience of
 using a connection provided by the Websphere pool to handle connected
 components, i.e. Struct or ARRAY in Oracle.
 
 We are getting a ClassCastException since driver attempts to cast the
 connection to an OracleConnection, and WAS pool provided connection
does
 not implement OracleConnection since is a connection provided by IBM
 classes. Any workaround? We are stuck with this issue.
 
 If you ask to IBM support they probably response you to use DB2 so not

 really helpful. Any experience?
 
 TIA,
 
 Adolfo.
 
 From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List
[EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: How to use datasource and db connection pooling in
struts?
 Date: Tue, 15 Oct 2002 10:42:13 -0400
 
 you can use commons-dbcp ... see
 http://jakarta.apache.org/commons/dbcp.html
 
 ---
 - Nayan Hajratwala
 - Chikli Consulting LLC
 - http://www.chikli.com
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 15, 2002 10:40 AM
 To: [EMAIL PROTECTED]
 Subject: How to use datasource and db connection pooling in struts?
 
 
 Hi, there!
 
 How can I easily achieve database connection pooling (using a
datasource
 in one of the xml config files - btw. which one is it?)?
 I know there is some stuff in jakarta-commons.
 What I want to achieve is an easy to configure and highly efficient
db
 connection pool that is available to all my action classes.
 
 Stef.
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 
 _
 MSN Photos is the easiest way to share and print your photos:
 http://photos.msn.com/support/worldwide.aspx
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 
 _
 MSN Photos is the easiest way to share and print your photos:
 http://photos.msn.com/support/worldwide.aspx
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]




HTML
   HEAD
  TITLEAdolfo's signature/TITLE
   /HEAD
   BODY
  centerbemAdolfo Rodriguez Miguelez/emb/center

   /BODY
   /HTML





_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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


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




HTML
  HEAD
 TITLEAdolfo's signature/TITLE
  /HEAD
  BODY
 centerbemAdolfo Rodriguez Miguelez/emb/center

  /BODY
  /HTML





_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [OT] WAS Connection Pool

2002-10-15 Thread Adolfo Miguelez

Firsly, thanks for your response:

Yeah, I knew the issue appears also for WL. I have seem the problem quite 
complained in the web, but no the solution.

Probably I will need to write and read.

My employer want to use a pool managed by WAS itself. Preferably WAS pool, 
but it seems not possible. Is it possible to configure a different pool for 
WAS? e.g. Oracle pool? Have you tried it for WL?

Any pointer to some way to proceed would be kindly appreciated. Absolutely 
lost, how to bind the OracleConnectionCacheImpl to JNDI and configure it, if 
possible, to WAS.

Adolfo.

From: Kris Schneider [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: [OT] WAS Connection Pool
Date: Tue, 15 Oct 2002 11:48:37 -0400

If it works anything like WLS, you'll get an instance of a class that
implements Connection, but it won't be an instance of OracleConnection.

Adolfo, do you want to read or write the structs/arrays?

For reading, you should be able to use java.sql.SQLData to generically 
handle
data retrieval. For writing, you may have to couple a bit more closely with
Oracle-specific classes. Oracle has a tool called JPublisher that can 
generate
Java classes from SQL objects, collection types (e.g. varray), and PL/SQL
packages. It might be worth checking out, but it may tie you directly to an
Oracle-specific solution. That's not always a big issue, but just something 
to
be aware of.

Another option is to just create and configure an instance of
OracleConnectionCacheImpl within your app, bind it as a JNDI resource, and 
just
use that as your connection pool.

Quoting David Graham [EMAIL PROTECTED]:

  What database driver class are you using?  It seems like you should be 
able
 
  to tell WAS to use the oracle db driver which would return
  OracleConnections.
 
  Dave
 
 
  From: Adolfo Miguelez [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: RE: How to use datasource and db connection pooling in struts?
  Date: Tue, 15 Oct 2002 14:58:46 +
  
  
  Taking advantage of this thread. Has any of you had the experience of 
using
 
  a connection provided by the Websphere pool to handle connected 
components,
 
  i.e. Struct or ARRAY in Oracle.
  
  We are getting a ClassCastException since driver attempts to cast the
  connection to an OracleConnection, and WAS pool provided connection 
does
  not implement OracleConnection since is a connection provided by IBM
  classes. Any workaround? We are stuck with this issue.
  
  If you ask to IBM support they probably response you to use DB2 so not
  really helpful. Any experience?
  
  TIA,
  
  Adolfo.
  
  From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Subject: RE: How to use datasource and db connection pooling in 
struts?
  Date: Tue, 15 Oct 2002 10:42:13 -0400
  
  you can use commons-dbcp ... see
  http://jakarta.apache.org/commons/dbcp.html
  
  ---
  - Nayan Hajratwala
  - Chikli Consulting LLC
  - http://www.chikli.com
  
  
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, October 15, 2002 10:40 AM
  To: [EMAIL PROTECTED]
  Subject: How to use datasource and db connection pooling in struts?
  
  
  Hi, there!
  
  How can I easily achieve database connection pooling (using a 
datasource
  in one of the xml config files - btw. which one is it?)?
  I know there is some stuff in jakarta-commons.
  What I want to achieve is an easy to configure and highly efficient db
  connection pool that is available to all my action classes.
  
  Stef.
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  
  
  
  _
  MSN Photos is the easiest way to share and print your photos:
  http://photos.msn.com/support/worldwide.aspx
  
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 
 
 
  _
  MSN Photos is the easiest way to share and print your photos:
  http://photos.msn.com/support/worldwide.aspx
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 


--
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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




HTML
  HEAD
 TITLEAdolfo's signature/TITLE
  /HEAD
  BODY
 centerbemAdolfo Rodriguez Miguelez/emb/center

  /BODY
  /HTML

  1   2   3   >