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 Hennebelle <ol...@sap.ap-hop-paris.fr> on 2003/12/18 15:32:49 UTC
Problem with cursors
Hi,
When I make my tests with OJB (0.9.7), I have got an Oracle's error :
ORA-01000: maximum open cursors exceeded
This error appear when I use PB API and the method getIteratorByQuery, a
cursor is use with the iterator I keep but is not close.
For found this error, I have two tests, each test is passed 100 times. Each
test ask a maximum of 30 lines in the database (I must write these lines in
my application in a list 30 by 30).
The first test have criteria who take 10 lines in the database, I take them
with my iterator (I make an iterator.next()) and the iterator stop after 10
lines.
The second test have no criterias, we have thousand and thousand lines who
are possible to take, OJB takes the 30 first lines.
The first works fine (100 times) but the second stop after the 50 (In the
database, we have put a maximum of 50 cursors).
That's why I think the iterator keep the cursor because it is always
possible to ask the others lines.
I tried to make while (iterator.hasNext()) iterator.next(), it works but
take too much time.
I have already add broker.close() for close the PB at the end of my code,
but it doesn't close the cursor.
Do you have this problem before, do you solve it ?
Is there a configuration on OJB which can suppress cursors ? Must I use JDBC
directly for suppress them ?
Thanks in advance for your answer.
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Order of field-descriptor id entries at repository
Posted by Guido Beutler <gu...@hrs.de>.
Hello,
I had some stange values aut objects since updated to RC5.
After some debuging I found out that I got illegal values at attributes
which does not match with the database. For example I got a attribute
at tahe object with the value 15 where a 0 is stored at the corresponding
database row.
The solution was the sort order at the repository_user.xml.
My repository_user.xml was auto generated and did not represent the correct
order of field-descriptor id's. I former time this worked.
Now it seems that the id's must have the correct order. After sorting the
repository everything worked fine. All the fields had the correct id so
it was not a real mapping error. I just thougt that OJB uses the
field-descriptor for mapping the column.
I'll now sort my repository an think that everything will work after that.
Will this problem be fixed? I thing trusting in the position is dangerous.
best regards,
Guido
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Database not found
Posted by Jim Theodoridis <oj...@tera.gr>.
Hi
I am using ojb with struts and Tomcat 4.1.24
I am getting the following message
org.apache.jasper.JasperException: org.odmg.DatabaseNotFoundException: OJB
can't open database repository.xml
Borrow broker from pool failed: Creation of a new PB instance failed
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
..........
when i am trying to work with odmg
but if i work with PB the application run with out problem
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
RE: Problem with cursors
Posted by Hennebelle <ol...@sap.ap-hop-paris.fr>.
Thank you, it works now.
Hello,
Hennebelle wrote:
> When I make my tests with OJB (0.9.7), I have got an Oracle's error :
> ORA-01000: maximum open cursors exceeded
>
> This error appear when I use PB API and the method getIteratorByQuery, a
> cursor is use with the iterator I keep but is not close.
You can cast the returned Iterator to OJBIterator, which will give you
access to the following method:
/**
* Release all internally used Database resources of the iterator.
* Clients must call this methods explicitely if the iterator is not
* exhausted by the client application. If the Iterator is exhauseted
* this method will be called implicitely.
*/
public void releaseDbResources();
(Otherwise, you are right about this method beeing called when doing
.next() calls to the end. Also, it's called automagically in finalize()
of the concrete OJBIterator implementation.)
HTH,
Martin
--
Martin Kalén
Curalia AB Web: http://www.curalia.se
Orrspelsvägen 2B Mail: info@curalia.se
SE-182 79 Stocksund Tel: +46-8-410 064 40
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Problem with cursors
Posted by Martin Kalén <ma...@curalia.se>.
Hello,
Hennebelle wrote:
> When I make my tests with OJB (0.9.7), I have got an Oracle's error :
> ORA-01000: maximum open cursors exceeded
>
> This error appear when I use PB API and the method getIteratorByQuery, a
> cursor is use with the iterator I keep but is not close.
You can cast the returned Iterator to OJBIterator, which will give you
access to the following method:
/**
* Release all internally used Database resources of the iterator.
* Clients must call this methods explicitely if the iterator is not
* exhausted by the client application. If the Iterator is exhauseted
* this method will be called implicitely.
*/
public void releaseDbResources();
(Otherwise, you are right about this method beeing called when doing
.next() calls to the end. Also, it's called automagically in finalize()
of the concrete OJBIterator implementation.)
HTH,
Martin
--
Martin Kalén
Curalia AB Web: http://www.curalia.se
Orrspelsvägen 2B Mail: info@curalia.se
SE-182 79 Stocksund Tel: +46-8-410 064 40
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org