Thanks, but this still does not work for me, maybe It is the nested queries. I haven't
the time to set up to debug this. I'm reverting to my hack which always closes the
most recently used connection with:
public void close( Object sqldoc )throws SQLException
{
int size = m_OpenSQLDocuments.size();
Object o = m_OpenSQLDocuments.elementAt(size-1);
((SQLDocument)o).close();
m_OpenSQLDocuments.removeElementAt(size-1);
}
Yuk! :(
Regards, Phil Friedman - Terralink Software - 1-207-772-6500 x101
Moraine Didier wrote:
[Trying to join the thread]
Hello,
We have the same problem and this is what we tried today :
public void close( Object sqldoc ) throws SQLException {
if (DEBUG)
System.out.println("Entering XConnection.close(" + sqldoc + ")");
if (sqldoc instanceof DTMNodeIterator) {
DTMNodeIterator dtmIter = (DTMNodeIterator) sqldoc;
if (dtmIter.getDTMIterator() instanceof XNodeSet) {
XNodeSet xNS = (XNodeSet) dtmIter.getDTMIterator();
if (xNS.getContainedIter() instanceof OneStepIterator) {
OneStepIterator iter = (OneStepIterator)
xNS.getContainedIter();
DTMManager dtmMgr = (DTMManager) iter.getDTMManager();
//Finally :-)
if (dtmMgr.getDTM(xNS.nextNode()) instanceof SQLDocument) {
sqldoc = (SQLDocument) dtmMgr.getDTM(xNS.nextNode());
int size = m_OpenSQLDocuments.size();
for (int x = 0; x < size; x++) {
SQLDocument d = (SQLDocument)
m_OpenSQLDocuments.elementAt(x);
if (d == sqldoc) {
d.close();
m_OpenSQLDocuments.removeElementAt(x);
}
}
} else {
throw new RuntimeException(
"Class cast exception XConnection.close(Object)
!");
}
} else {
throw new RuntimeException(
"Class cast exception XConnection.close(Object) !");
}
} else {
throw new RuntimeException(
"Class cast exception XConnection.close(Object) !");
}
}
}
We are now able to close a single SQLDocument and put back the connection in
the pool
with :
<xsl:variable name="Qy" select="sql:query($DbCon, $SQL)"/>
...
<xsl:value-of select="sql:close($DbCon, $Qy)"/>
Regards,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]