You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Aguirre, Carlos (C.)" <ca...@visteon.com> on 2003/05/14 18:43:47 UTC
Infinite loop
Hi i'm new to OJB,
i have these little pize of code and it's cousing an infinite loop, with a
lot of these messages:
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO:
Destroy object was called, try to close connection:
com.mysql.jdbc.jdbc2.Connection@110c31
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN:
Validation query for connection failed, discard connection. Query was a
query, Message was Syntax error or access violation: You have an error in
your SQL syntax. Check the manual that corresponds to your MySQL server
version for the right syntax to use near 'a query' at line 1
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO:
Destroy object was called, try to close connection:
com.mysql.jdbc.jdbc2.Connection@3785d3
public static void main(String args[]){
PBKey pb = new PBKey("mysql");
PersistenceBroker db =
PersistenceBrokerFactory.createPersistenceBroker(pb);
System.out.println(db.toString());
Query q = new QueryByCriteria(Product.class, null);
System.out.println(q.toString());
Collection c = db.getCollectionByQuery(q);
java.util.Iterator i = c.iterator();
System.out.println(i.next());
}
Does anyone know what could be??
Thanks..