> Paolo Salvan wrote: > >>Hi! >> >>I' starting the development of a non-trivial web app using ojb, mysql, >> and jsp... >> >>I havent't clear ideas about which is the right moment to create/close >> the various objects, to get the best architecture and to take advantage >> of the connection-pooling.
connection-pooling... well JDBC 2.0 (or was it 3.0... or is just some mixed up idea) drivers don't take care of connection pooling themselves? >> >>In order to launch queries, to update data and so on, I need the >> following 3 objects: >> >>- an ojb instance just the PersistenceBroker, PersistenceManager or the ODMG equivalent is needed. These must not be shared and be closed when finished (just like JDBC connections). >>- a db connection >>- a transaction >> >>I can create them at the global application level, at the user session >> level or at the single jsp level... but it isn't obvius to me what is >> the right solution... any help? I usually initialize and share a factory (on JDO it is the PersistenceBrokerFactory) among all DAOs to create the PersistenceBroker or PersistenceManager. I use the VO (Value objects) to pass information between the DAO and the actions (Struts). >> > You most certainly don't want to code business functionality right into > the JSP. Your project sounds like it would benefit from the Struts > framework, have a look here: http://jakarta.apache.org/struts/ and here > for a tutorial: http://www.fawcette.com/javapro/2002_07/online/kjones/ Struts will certainly be a good idea :) Pedro Salgado --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]