Hi,

can you set eager-release 'false' and run your test again?
Maybe it's a side-effect of eager-release.

regards,
Armin

On Tue, 14 Oct 2003 17:59:50 +0200, Benjamin Wagner <[EMAIL PROTECTED]> wrote:

Hi all,

I need to execute my own SQL Statements by using QueryBySQL.
I figured out that the only way to do this, is to use the
getReportQueryIteratorByQuery method.
If i use getCollectionByQuery or getIteratorByQuery as writen in the FAQs,
the statment is chnaged somehow and not the one i want and need.


After i execute the ReportQuery i get the correct result, but i get the
following warning from the jboss:

WARN [WrappedConnection] Closing a statement you left open, please do your
own housekeeping
INFO [CachedConnectionManager] Successfully closed a connection for you.
Please close them yourself:
org.jboss.resource.adapter.jdbc.WrappedConnection
java.lang.Exception: Stack Trace
at
org.jboss.resource.connectionmanager.CachedConnectionManager.closeAll(Cached
ConnectionManager.java:376)


with a long Stack Trace.
The Problem now is, that when i want to get some objects for the next time,
i get the following error without any db-results:


INFO [STDOUT] [org.apache.ojb.broker.accesslayer.StatementsForClassImpl]
ERROR:
INFO [STDOUT] Connection handle has been closed and is unusable
ERROR [STDERR] java.sql.SQLException: Connection handle has been closed and
is unusable
ERROR [STDERR] at
org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnect
ion.java:800)
ERROR [STDERR] at
org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedCo
nnection.java:240)
ERROR [STDERR] at
org.apache.ojb.broker.util.WrappedConnection.prepareStatement(Unknown
Source)
.....and so on.


My Code looks like this:

public Object[] getObjectByReportQuery(Class target, String sql) {
 Object[] obj = null;
        Iterator result = null;

        PersistenceBroker broker = getBroker();
        Query q = QueryFactory.newQuery(target, sql);

        try {
            result = broker.getReportQueryIteratorByQuery(q);

            if ((result != null) && result.hasNext()) {
                obj = (Object[]) result.next();
            }

            return obj;
    }

My only work around is to write broker.beginTransaction() and
broker.commitTransaction() at the start and end of the function, which is
not a solution for me, since the management of the transactions should be
done by beans above.

thanks for your help.
Ben


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



Reply via email to