-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Where to submit patch for Oracle reverse engineering?
PostPosted: Fri Dec 16, 2005 6:50 pm 
Newbie

Joined: Fri Dec 16, 2005 6:31 pm
Posts: 3
I believe I've found a workaround for a bug when reverse engineering large Oracle schemas, but I'm not sure what to do with it. Currently, I'm working with Middlegen, but didn't know if that would filter back to this project, or if both projects could use the patch, or maybe just this project. Can anyone advise?

The schema I've inherited has 1100 tables in it, and no, that wasn't my idea. It's several years old and drives several legacy apps, so it can't change. Middlegen continually choked on it by causing Oracle to generate a "too many open cursors" error. Hibernate Tools runs into the exact same error, leading me to hope that this project imports Middlegen, rather than reinventing it.

I still haven't isolated the root cause, but I'm guessing it's actually in Oracle's JDBC code for retrieving metadata. I could be wrong, but since I can't access that code, the next best thing is to cobble up a patch for Middlegen (and/or Hibernate Tools) to avoid the problem.

The Ugly Hack I used to make things work in Middlegen was pretty simple: Alter MiddlegenPopulator.java to forcibly close and reopen the database connection after processing "X" (usually 20) tables. Reopening the connection requires re-retrieving the database metadata, but otherwise everything works.

I'm trying to get time to work with the DBA team to see if we can't isolate the actual problem to something smaller, with a more elegant fix, but this was the best I could do on short notice.

My problem now is, what do I patch? Middlegen? Hibernate Tools? Both? Some other area?

Thanks for any pointers on what to do next.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 16, 2005 9:24 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Quote:
'm trying to get time to work with the DBA team to see if we can't isolate the actual problem to something smaller, with a more elegant fix, but this was the best I could do on short notice.


tell DBA that increase open cursors parameter - it is simple
true name for parameter is 'open_cursors' and set number value (more 1000's for your case)
you need set next :
open_cursors=10000
to init.ora file and it is all

close and reopen connection can introduce bug for another databases

i try with datadirect drivers (work for smaller schema when oracle driver throw cursor error) , but for my schema it worked more hours (i don't know true how long, because i break it)
I think that it close and open connections after statements and introduce horrible performance problems

oracle driver work fine when you increase open cursors

except this you have reveng table filters and i think that you don't reversed 1100 tables in one moment

regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 16, 2005 11:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Increasing the number of cursors is the correct solution. In anycase, MIddlegen and HIbernate tools have there respective areas in which to place patches etc for consideration.


Top
 Profile  
 
 Post subject: Thanks!
PostPosted: Sat Dec 17, 2005 12:59 am 
Newbie

Joined: Fri Dec 16, 2005 6:31 pm
Posts: 3
OK, I wasn't sure if asking for more cursors was a good or bad thing to do, but if it's the better solution, I'll do that instead. I think I had run into some resistance with that earlier, but that shouldn't matter for a one-time object generation scenario in development.

Thanks for the advice guys! This saves me a whole lot of work!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 17, 2005 8:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the issue is fixed in hibernate tools cvs. It is caused by what i call a bug in their drivers.

When calling getIndexInfo and it errors oracle leaks cursors.

I have added checks so that shouldnt happen again.

so in short, just use hibernate tools.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Best answer yet!
PostPosted: Sat Dec 17, 2005 5:01 pm 
Newbie

Joined: Fri Dec 16, 2005 6:31 pm
Posts: 3
Thanks Max! That's the best possible outcome for this. I wasn't looking forward to tracing down the cause.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 18, 2005 5:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Excellent!!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.