Hi Jeremy,
Jahia's main servlet takes care of that for you. If you are not going through Jahia's servlet though (for example if you are calling a JSP directly or something like that), you will have to call ConnectionDispenser.terminateConnection or ConnectionDispenser.abortConnection AT THE END OF THE HTTP request only ! (so once only). This is necessary so that when we activate DB transactions we won't have any problems.
Regards, Serge Huber.
Jeremy Torres wrote:
How should the connection retrieved from "org.jahia.services.database.ConnectionDispenser.getConnection ()" be closed (or should it be closed at all?
Thanks, Jeremy
Serge Huber wrote:
Hi Jeremy,
You can retrieve the connection Jahia uses in the current thread through the following call :
Connection connection = org.jahia.services.database.ConnectionDispenser.getConnection ();
Regards, Serge Huber.
Jeremy Torres wrote:
Is it possible to get a reference to the database connection pool that Jahia uses? I would like a Java class, utilized within a template, to get a database connection to the same database, where I would have my own tables.
Thanks, Jeremy
