troubleshooting Question

Bizarre Oracle Metadata Problem When Using 'conn.getMetaData()' in Java

Avatar of ajbufort
ajbufort asked on
Databases
6 Comments1 Solution634 ViewsLast Modified:
Hello,

   I wrote a db-class auto-generator for my company that creates classes corresponding to tables in our Oracle database (we were on 9i, but recently moved to 9.2).  The utility worked just fine for quite a while (in 9i), and then all of a sudden we experienced a corruption in the metadata it was seeing.  We were still using 9i then, so the problem has nothing to do with a version change.  Our dba swears that there were no changes during the period in which the metadata corruption began, and the corruption only seems to be visible when using the conn.getMetaData() method; making similar requests for the metadata in SQL*Plus, for example, yields the correct data, and the tables are showing up fine in TOAD.
   The exact nature of the corruption involves the repetition of tables and fields.  When I use the auto-generator, some tables have classes generated for them numerous times, because the metadata is telling the utility that certain tables exist numerous times.  Also, it is interesting to note that the fields within the auto-generated classes get generated as many times as the classes themselves do.  So, for example, if the metadata that the util received said that there were three TABLE_CUSTOMER tables, and that class got generated three times, the final file would have members that look like this:

protected String _OBJID = null;
protected String _ADDRESS = null;
protected String _ADDRESS_2 = null;
protected String _CITY = null;
protected String _OBJID = null;
protected String _ADDRESS = null;
protected String _ADDRESS_2 = null;
protected String _CITY = null;
protected String _OBJID = null;
protected String _ADDRESS = null;
protected String _ADDRESS_2 = null;
protected String _CITY = null;

As you can imagine, this results in a real mess.

When we finally moved to 9.2, we saw the same corruption, but on a smaller scale, generally speaking.  Now, I am only seeing 6 tables repeat instead of most or all of them (100+).

Is there something our DBA needs to do (or not do)?  What totally puzzles me is that this situation supposedly arose all of a sudden, with nothing changing on either the Java or Oracle ends.  I can speak to the Java side of things and say that we didn't swicth JSDKs or JDBC drivers or anything like that.  I find it hard to believe, however, that SOMETHING did not change on the Oracle side to provoke this.  BUT... it IS only showing up when we retrieve the metadata from Java, making the theory that Java is somehow involved look tempting.

   I am sure that with the severity of the symptoms we are experiencing that someone has run into and dealt with this before.  I have a feeling the answer is subtle yet simple, but we have yet to discover it.

PLASE HELP!

Thanks In Advance,

Anthony

ASKER CERTIFIED SOLUTION
Netminder

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros