database export to dbunti xml

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

database export to dbunti xml

fachhoch
I am trying to export my database inot flat xml file for unit testing.I follwed this example  http://www.dbunit.org/faq.html#extract

I am ending up with this exception please hlep me resolve this


Exception in thread "main" org.dbunit.database.AmbiguousTableNameException: PLAN_TABLE
    at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161)
    at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203)
    at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251)
    at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110)
    at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129)
    at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89)
    at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189)
    at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63)
    at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
    at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323)
    at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)


I also tried the   suggfestion http://www.gigantiq.com/blogs/mike/?p=10  but did not work , any how this artricle did not said the value for   DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES

my code to set this property
connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES, "true");

please tell me what should be the value for this property .





------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

John Hurst-2
Are you specifying the schema? Sounds like you have PLAN_TABLE in multiple schemas. This is normal with Oracle.

Regards

John Hurst
Wellington, New Zealand

On Tue, Jul 21, 2009 at 3:42 PM, tubin gen <[hidden email]> wrote:
I am trying to export my database inot flat xml file for unit testing.I follwed this example  http://www.dbunit.org/faq.html#extract

I am ending up with this exception please hlep me resolve this


Exception in thread "main" org.dbunit.database.AmbiguousTableNameException: PLAN_TABLE
    at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161)
    at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203)
    at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251)
    at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110)
    at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129)
    at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89)
    at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189)
    at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63)
    at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
    at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323)
    at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)


I also tried the   suggfestion http://www.gigantiq.com/blogs/mike/?p=10  but did not work , any how this artricle did not said the value for   DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES

my code to set this property
connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES, "true");

please tell me what should be the value for this property .





------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

Zdenek Vrablik
In reply to this post by fachhoch
Hi I have got same issue.

I have solved (temporarily) with replacing the exception with stdout message.

The best recommendation was create table filter, see in mailing list.

I have got same issue with column names.

I could send you diff files.

Regards,
Zdenek

On Tue, Jul 21, 2009 at 4:42 AM, tubin gen<[hidden email]> wrote:

> I am trying to export my database inot flat xml file for unit testing.I
> follwed this example  http://www.dbunit.org/faq.html#extract
>
> I am ending up with this exception please hlep me resolve this
>
>
> Exception in thread "main" org.dbunit.database.AmbiguousTableNameException:
> PLAN_TABLE
>     at
> org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161)
>     at
> org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203)
>     at
> org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251)
>     at
> org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110)
>     at
> org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129)
>     at
> org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89)
>     at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189)
>     at
> org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63)
>     at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
>     at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323)
>     at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)
>
>
> I also tried the   suggfestion http://www.gigantiq.com/blogs/mike/?p=10  but
> did not work , any how this artricle did not said the value for
> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES
>
> my code to set this property
> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES,
> "true");
>
> please tell me what should be the value for this property .
>
>
>
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
>

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

fachhoch
please send  them.
thanks

Zdenek Vrablik wrote
Hi I have got same issue.

I have solved (temporarily) with replacing the exception with stdout message.

The best recommendation was create table filter, see in mailing list.

I have got same issue with column names.

I could send you diff files.

Regards,
Zdenek

On Tue, Jul 21, 2009 at 4:42 AM, tubin gen<fachhoch@gmail.com> wrote:
> I am trying to export my database inot flat xml file for unit testing.I
> follwed this example  http://www.dbunit.org/faq.html#extract
>
> I am ending up with this exception please hlep me resolve this
>
>
> Exception in thread "main" org.dbunit.database.AmbiguousTableNameException:
> PLAN_TABLE
>     at
> org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161)
>     at
> org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203)
>     at
> org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251)
>     at
> org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110)
>     at
> org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129)
>     at
> org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89)
>     at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189)
>     at
> org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63)
>     at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
>     at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323)
>     at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)
>
>
> I also tried the   suggfestion http://www.gigantiq.com/blogs/mike/?p=10  but
> did not work , any how this artricle did not said the value for
> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES
>
> my code to set this property
> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES,
> "true");
>
> please tell me what should be the value for this property .
>
>
>
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> dbunit-user mailing list
> dbunit-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
>

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
dbunit-user mailing list
dbunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

Luiz Eduardo Guida Valmont-2
In reply to this post by fachhoch
Please take a look at the FAQ, as there is a specific question on AmbiguousTableNameException. This should solve your problem.

Regards,
Luiz

2009/7/21 tubin gen <[hidden email]>
I am trying to export my database inot flat xml file for unit testing.I follwed this example  http://www.dbunit.org/faq.html#extract

I am ending up with this exception please hlep me resolve this


Exception in thread "main" org.dbunit.database.AmbiguousTableNameException: PLAN_TABLE
    at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161)
    at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203)
    at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251)
    at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110)
    at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129)
    at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89)
    at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189)
    at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63)
    at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
    at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323)
    at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)


I also tried the   suggfestion http://www.gigantiq.com/blogs/mike/?p=10  but did not work , any how this artricle did not said the value for   DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES

my code to set this property
connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES, "true");

please tell me what should be the value for this property .





------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

Matthias Gommeringer
In reply to this post by fachhoch
Hi there,

try using the "getConfig().setFeature" instead of the "getConfig().setProperty()" since you are willing to set a feature here.

rgds,
matthias

> -----Ursprüngliche Nachricht-----
> Von: "Luiz Eduardo Guida Valmont" <[hidden email]>
> Gesendet: 21.07.09 19:06:54
> An: [hidden email]
> Betreff: Re: [dbunit-user] database export to dbunti xml

Please take a look at the FAQ, as there is a specific question on

> AmbiguousTableNameException. This should solve your problem.
>
> Regards,
> Luiz
>
> 2009/7/21 tubin gen <[hidden email]>
> I am trying to export my database inot flat xml file for unit testing.
> I follwed this example http://www.dbunit.org/faq.html#extract
>
> I am ending up with this exception please hlep me resolve this
>
> Exception in thread "main" org.dbunit.database.AmbiguousTableNameExcept
> ion: PLAN_TABLE
>  at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.
> java:161)
>  at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.
> java:203)
>  at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSe
> t.java:251)
>  at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(
> SequenceTableFilter.java:110)
>  at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTabl
> eFilter.java:129)
>  at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.
> java:89)
>  at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:
> 189)
>  at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(
> DataSetProducerAdapter.java:63)
>  at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
>  at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:
> 323)
>  at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)
>
> I also tried the suggfestion http://www.gigantiq.com/blogs/mike/?p=10 
> but did not work , any how this artricle did not said the value for
> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES
>
> my code to set this property
> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_
> RECYCLEBIN_TABLES, "true");
>
> please tell me what should be the value for this property .
>
> ----------------------------------------------------------------------
> --------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited
> time,
> vendors submitting new applications to BlackBerry App World(TM) will
> have
> the opportunity to enter the BlackBerry Developer Challenge. See full
> prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
> ----------------------------------------------------------------------
> --------_______________________________________________ dbunit-user
> mailing list [hidden email] https://lists.
>
> sourceforge.net/lists/listinfo/dbunit-user


________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/


------------------------------------------------------------------------------
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

Rusty Wright-2
In my opinion it's unfortunate that getConfig().setFeature() and getConfig().setProperty() don't throw an exception when given a a feature or property that they can't use.  I made this mistake and even saw the warning in the log files, but being the wooden head that I am it took me a while to realize what was wrong.


Matthias Gommeringer wrote:

> Hi there,
>
> try using the "getConfig().setFeature" instead of the "getConfig().setProperty()" since you are willing to set a feature here.
>
> rgds,
> matthias
>
>> -----Ursprüngliche Nachricht-----
>> Von: "Luiz Eduardo Guida Valmont" <[hidden email]>
>> Gesendet: 21.07.09 19:06:54
>> An: [hidden email]
>> Betreff: Re: [dbunit-user] database export to dbunti xml
>
> Please take a look at the FAQ, as there is a specific question on
>> AmbiguousTableNameException. This should solve your problem.
>>
>> Regards,
>> Luiz
>>
>> 2009/7/21 tubin gen <[hidden email]>
>> I am trying to export my database inot flat xml file for unit testing.
>> I follwed this example http://www.dbunit.org/faq.html#extract
>>
>> I am ending up with this exception please hlep me resolve this
>>
>> Exception in thread "main" org.dbunit.database.AmbiguousTableNameExcept
>> ion: PLAN_TABLE
>>  at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.
>> java:161)
>>  at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.
>> java:203)
>>  at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSe
>> t.java:251)
>>  at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(
>> SequenceTableFilter.java:110)
>>  at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTabl
>> eFilter.java:129)
>>  at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.
>> java:89)
>>  at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:
>> 189)
>>  at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(
>> DataSetProducerAdapter.java:63)
>>  at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
>>  at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:
>> 323)
>>  at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)
>>
>> I also tried the suggfestion http://www.gigantiq.com/blogs/mike/?p=10 
>> but did not work , any how this artricle did not said the value for
>> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES
>>
>> my code to set this property
>> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_
>> RECYCLEBIN_TABLES, "true");
>>
>> please tell me what should be the value for this property .
>>
>> ----------------------------------------------------------------------
>> --------
>> Enter the BlackBerry Developer Challenge
>> This is your chance to win up to $100,000 in prizes! For a limited
>> time,
>> vendors submitting new applications to BlackBerry App World(TM) will
>> have
>> the opportunity to enter the BlackBerry Developer Challenge. See full
>> prize
>> details at: http://p.sf.net/sfu/Challenge
>> _______________________________________________
>> dbunit-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>>
>> ----------------------------------------------------------------------
>> --------_______________________________________________ dbunit-user
>> mailing list [hidden email] https://lists.
>>
>> sourceforge.net/lists/listinfo/dbunit-user
>
>
> ________________________________________________________________
> Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
> für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user

------------------------------------------------------------------------------
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

Matthias Gommeringer
In reply to this post by fachhoch
I absolutely agree. I believe there is already a feature request, just the lack of time hinders us from improving the API...so feel free to submit a patch! Actually I was thinking about deprecating the "setFeature" and letting the "setProperty" do everything.

rgds,
matthias

> -----Ursprüngliche Nachricht-----
> Von: "Rusty Wright" <[hidden email]>
> Gesendet: 21.07.09 22:11:50
> An: [hidden email]
> Betreff: Re: [dbunit-user] database export to dbunti xml


> In my opinion it's unfortunate that getConfig().setFeature() and getConfig().setProperty() don't throw an exception when given a a feature or property that they can't use.  I made this mistake and even saw the warning in the log files, but being the wooden head that I am it took me a while to realize what was wrong.
>
>
> Matthias Gommeringer wrote:
> > Hi there,
> >
> > try using the "getConfig().setFeature" instead of the "getConfig().setProperty()" since you are willing to set a feature here.
> >
> > rgds,
> > matthias
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: "Luiz Eduardo Guida Valmont" <[hidden email]>
> >> Gesendet: 21.07.09 19:06:54
> >> An: [hidden email]
> >> Betreff: Re: [dbunit-user] database export to dbunti xml
> >
> > Please take a look at the FAQ, as there is a specific question on
> >> AmbiguousTableNameException. This should solve your problem.
> >>
> >> Regards,
> >> Luiz
> >>
> >> 2009/7/21 tubin gen <[hidden email]>
> >> I am trying to export my database inot flat xml file for unit testing.
> >> I follwed this example http://www.dbunit.org/faq.html#extract
> >>
> >> I am ending up with this exception please hlep me resolve this
> >>
> >> Exception in thread "main" org.dbunit.database.AmbiguousTableNameExcept
> >> ion: PLAN_TABLE
> >>  at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.
> >> java:161)
> >>  at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.
> >> java:203)
> >>  at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSe
> >> t.java:251)
> >>  at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(
> >> SequenceTableFilter.java:110)
> >>  at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTabl
> >> eFilter.java:129)
> >>  at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.
> >> java:89)
> >>  at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:
> >> 189)
> >>  at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(
> >> DataSetProducerAdapter.java:63)
> >>  at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
> >>  at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:
> >> 323)
> >>  at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)
> >>
> >> I also tried the suggfestion http://www.gigantiq.com/blogs/mike/?p=10 
> >> but did not work , any how this artricle did not said the value for
> >> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES
> >>
> >> my code to set this property
> >> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_
> >> RECYCLEBIN_TABLES, "true");
> >>
> >> please tell me what should be the value for this property .
> >>
> >> ----------------------------------------------------------------------
> >> --------
> >> Enter the BlackBerry Developer Challenge
> >> This is your chance to win up to $100,000 in prizes! For a limited
> >> time,
> >> vendors submitting new applications to BlackBerry App World(TM) will
> >> have
> >> the opportunity to enter the BlackBerry Developer Challenge. See full
> >> prize
> >> details at: http://p.sf.net/sfu/Challenge
> >> _______________________________________________
> >> dbunit-user mailing list
> >> [hidden email]
> >> https://lists.sourceforge.net/lists/listinfo/dbunit-user
> >>
> >> ----------------------------------------------------------------------
> >> --------_______________________________________________ dbunit-user
> >> mailing list [hidden email] https://lists.
> >>
> >> sourceforge.net/lists/listinfo/dbunit-user
> >
> >
> > ________________________________________________________________
> > Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
> > für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/
> >
> >
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > dbunit-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
> ------------------------------------------------------------------------------
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


------------------------------------------------------------------------------
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

Zdenek Vrablik
In reply to this post by fachhoch
Hi,

here is the diff which filter out column name duplicates from Oracle Metadata.

I am currently using 4.6. SNAPSHOT. I am sure there is better way to
do it (at least
filter out duplicate tables).

Index: src/java/org/dbunit/dataset/OrderedTableNameMap.java
===================================================================
--- src/java/org/dbunit/dataset/OrderedTableNameMap.java (revision 1013)
+++ src/java/org/dbunit/dataset/OrderedTableNameMap.java (working copy)
@@ -187,6 +187,7 @@
  */

  public void add(String tableName, Object object) throws
AmbiguousTableNameException

  {

+      System.out.println(tableName);

         if(LOGGER.isDebugEnabled())

             LOGGER.debug("add(tableName={}, object={}) - start",
tableName, object);

 

@@ -195,7 +196,8 @@
         // prevent table name conflict

         if (this.containsTable(tableNameCorrectedCase))

         {

-            throw new AmbiguousTableNameException(tableNameCorrectedCase);

+            //throw new AmbiguousTableNameException(tableNameCorrectedCase);

+        System.out.println("table name twice! table name: " + tableName);

         }

         else {

             this._tableMap.put(tableNameCorrectedCase, object);
Index: src/java/org/dbunit/database/DatabaseTableMetaData.java
===================================================================
--- src/java/org/dbunit/database/DatabaseTableMetaData.java (revision 1013)
+++ src/java/org/dbunit/database/DatabaseTableMetaData.java (working copy)
@@ -321,6 +321,7 @@
                             DatabaseConfig.FEATURE_DATATYPE_WARNING);

                     List columnList = new ArrayList();
+                    List columnNames = new ArrayList();
                     while (resultSet.next())
                     {
                         // Check for exact table/schema name match because
@@ -329,9 +330,10 @@
                         if(match)
                         {
                             Column column =
SQLHelper.createColumn(resultSet, dataTypeFactory, datatypeWarning);
-                            if(column != null)
+                            if(column != null &&
!columnNames.contains( column.getColumnName() ))
                             {
                                 columnList.add(column);
+                                columnNames.add(column.getColumnName());
                             }
                         }
                         else


Regards,
Zdenek

On Tue, Jul 21, 2009 at 5:09 PM, fachhoch<[hidden email]> wrote:

>
> please send  them.
> thanks
>
>
> Zdenek Vrablik wrote:
>>
>> Hi I have got same issue.
>>
>> I have solved (temporarily) with replacing the exception with stdout
>> message.
>>
>> The best recommendation was create table filter, see in mailing list.
>>
>> I have got same issue with column names.
>>
>> I could send you diff files.
>>
>> Regards,
>> Zdenek
>>
>> On Tue, Jul 21, 2009 at 4:42 AM, tubin gen<[hidden email]> wrote:
>>> I am trying to export my database inot flat xml file for unit testing.I
>>> follwed this example  http://www.dbunit.org/faq.html#extract
>>>
>>> I am ending up with this exception please hlep me resolve this
>>>
>>>
>>> Exception in thread "main"
>>> org.dbunit.database.AmbiguousTableNameException:
>>> PLAN_TABLE
>>>     at
>>> org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161)
>>>     at
>>> org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203)
>>>     at
>>> org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251)
>>>     at
>>> org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110)
>>>     at
>>> org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129)
>>>     at
>>> org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89)
>>>     at
>>> org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189)
>>>     at
>>> org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63)
>>>     at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
>>>     at
>>> org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323)
>>>     at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)
>>>
>>>
>>> I also tried the   suggfestion http://www.gigantiq.com/blogs/mike/?p=10
>>> but
>>> did not work , any how this artricle did not said the value for
>>> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES
>>>
>>> my code to set this property
>>> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES,
>>> "true");
>>>
>>> please tell me what should be the value for this property .
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Enter the BlackBerry Developer Challenge
>>> This is your chance to win up to $100,000 in prizes! For a limited time,
>>> vendors submitting new applications to BlackBerry App World(TM) will have
>>> the opportunity to enter the BlackBerry Developer Challenge. See full
>>> prize
>>> details at: http://p.sf.net/sfu/Challenge
>>> _______________________________________________
>>> dbunit-user mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> Enter the BlackBerry Developer Challenge
>> This is your chance to win up to $100,000 in prizes! For a limited time,
>> vendors submitting new applications to BlackBerry App World(TM) will have
>> the opportunity to enter the BlackBerry Developer Challenge. See full
>> prize
>> details at: http://p.sf.net/sfu/Challenge
>> _______________________________________________
>> dbunit-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>>
>>
>
> --
> View this message in context: http://www.nabble.com/database-export-to-dbunti-xml-tp24581227p24590719.html
> Sent from the DBUnit - Users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>

------------------------------------------------------------------------------
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: database export to dbunti xml

charlottebraillie
In reply to this post by fachhoch
I had the same problem.
Turned out the <schema> element is only picked up by the mojo when specified in the
<configuration> element immediately within the <plugin> element.

So this works:
 <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>dbunit-maven-plugin</artifactId>
                <version>1.0-beta-3</version>
            <configuration>
                    <driver>oracle.jdbc.OracleDriver</driver>
                    <url>jdbc:oracle:thin:@mdydb:1523/mdydb</url>
                    <username>MYUSER</username>
                    <password>MYPASSWORD</password>
                    <skipOracleRecycleBinTables>true</skipOracleRecycleBinTables>                    <dataTypeFactoryName>org.dbunit.ext.oracle.Oracle10DataTypeFactory</dataTypeFactoryName>
                    <schema>MYSCHEMA</schema>
</configuration>

fachhoch wrote
I am trying to export my database inot flat xml file for unit testing.I
follwed this example  http://www.dbunit.org/faq.html#extract

I am ending up with this exception please hlep me resolve this


Exception in thread "main" org.dbunit.database.AmbiguousTableNameException:
PLAN_TABLE
    at
org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161)
    at
org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203)
    at
org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251)
    at
org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110)
    at
org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129)
    at
org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89)
    at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189)
    at
org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63)
    at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122)
    at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323)
    at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40)


I also tried the   suggfestion http://www.gigantiq.com/blogs/mike/?p=10  but
did not work , any how this artricle did not said the value for
DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES

my code to set this property
connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES,
"true");

please tell me what should be the value for this property .

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
dbunit-user mailing list
dbunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbunit-user