Re: Persistent Database Object

2007-05-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Asaf, Asaf Paris Mandoki wrote: > I'm planning to make an application that uses a MySQL Database. > > Should I have a persistent object with a persistent connection to the > database or is it better to create the connection each time i use it? It re

Re: Persistent Database Object

2007-05-13 Thread Josh Long
Use a Connection pool. Jakarta Commons has one that's comonly available and easily configured in Tomcat, Spring, in code, etc. Make the Connection pool persistant (As it might be if it were available in a Spring context, for example.), and then on each new "request" (ie, if you're going to use i

Persistent Database Object

2007-05-13 Thread Asaf Paris Mandoki
Hello, I understand, form reading the Walking Tour of the Struts 2 MailReader Application that they use an object that is created when the application starts, and stays there forever, to manage the data source (XML). I'm planning to make an application that uses a MySQL Database. Should I have