At 10:34 AM -0700 2002/09/11, Matthew Baird wrote:
>can you provide a test case for this? If you can someone will fix it.
I don't think I can, because I don't think it's in OJB code.
In fact, I just realized that even as this problem has cropped up,
there's another routine in the same application which gets an
iterator by SQL and iterates through over 900 transaction objects
without ever experiencing the destroyObject problem that comes up
when iterating through the extent of individual objects.
OK, this led me to look at what I was doing more carefully, and now I
understand my problem. I'll explain a bit in hopes that it may help
someone else...
I don't know all the internals of how OJB works, but the iterator was
failing because of other database I was doing during each iteration.
In my current design, some of the data in the report is calculated
for each row. To do the calculations, I was getting a database
connection (with broker.getConnectionManager().getConnection()),
doing my own arbitrary SQL, and closing the connection. I was doing
this for two calculations for each iteration through the individual
extent, and clearly, this activity somehow caused the errors I was
getting.
I reorganized my report application to hold onto one connection
exclusively for those "side calculations" during the run and to only
close it once, at the end of execution, and now the errors go away.
The errors never came up for the transaction extent because I wasn't
doing the calculations "on the side" for transactions, only for
individuals.
So now, I'll consider whether I should somehow get the values I'm
calculating into the database and simply read them at
report-generation time, or whether I can stick with my current
design, which feels a little bit like a hack. I guess I'm still not
quite ready to give up my SQL, even though I like OJB a lot.
Are there any guidelines for using a connection directly like this?
Or is it really not meant for public use?
Thanks for the quick responses...
Joe
--
--
* Joe Germuska { [EMAIL PROTECTED] }
"It's pitiful, sometimes, if they've got it bad. Their eyes get
glazed, they go white, their hands tremble.... As I watch them I
often feel that a dope peddler is a gentleman compared with the man
who sells records."
--Sam Goody, 1956
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>