Thanks for your help Ron. I switched to V2.0. I can't say I still
understand the mapping language well enough!
I was trying out the many-to-many relation example (actor/movie example
copy-paste from the FAQ page.) On MySQL, it somehow fails to insert the
second movie for actor ID=1. After updates this is how things look:
mysql> select * from joinmoviesactors;
+---------+---------+
| actorID | movieID |
+---------+---------+
| 1 | 2 |
| 2 | 2 |
| 3 | 1 |
+---------+---------+
Note: missing actorID=1 and movieID=1.
My mapping file:
===================================================================
<?xml version='1.0' ?>
<XMLToDBMS Version="2.0"
xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
<Options>
<SimpleDateFormat Pattern="MM/dd/yyyy"
DefaultForTypes="DATE" />
</Options>
<Databases>
<Database Name="Default">
<Catalog>
<Schema>
<Table Name="actors">
<Column Name="id" DataType="INTEGER"
Nullable="No"/>
<Column Name="name"
DataType="VARCHAR" Length="255" Nullable="Yes"/>
<PrimaryKey>
<UseColumn Name="id"/>
</PrimaryKey>
</Table>
<Table Name="movies">
<Column Name="id" DataType="INTEGER"
Nullable="No"/>
<Column Name="title"
DataType="VARCHAR" Length="255" Nullable="Yes"/>
<PrimaryKey>
<UseColumn Name="id"/>
</PrimaryKey>
</Table>
<Table Name="joinmoviesactors">
<Column Name="actorID"
DataType="INTEGER" Nullable="No"/>
<Column Name="movieID"
DataType="INTEGER" Nullable="No"/>
<PrimaryKey>
<UseColumn Name="actorID"/>
<UseColumn Name="movieID"/>
</PrimaryKey>
<ForeignKey Name="actor_FK">
<UseTable Name="actors"/>
<UseUniqueKey
Name="PrimaryKey" />
<UseColumn Name="actorID"/>
</ForeignKey>
<ForeignKey Name="movies_FK">
<UseTable Name="movies"/>
<UseUniqueKey
Name="PrimaryKey" />
<UseColumn Name="movieID"/>
</ForeignKey>
</Table>
</Schema>
</Catalog>
</Database>
</Databases>
<Maps>
<ClassMap>
<ElementType Name="Actor"/>
<ToClassTable Name="actors"/>
<PropertyMap>
<Attribute Name="ID"/>
<ToColumn Name="id"/>
</PropertyMap>
<PropertyMap>
<ElementType Name="Name"/>
<ToColumn Name="name"/>
</PropertyMap>
<RelatedClass KeyInParentTable="Unique">
<ElementType Name="Movies" />
<UseUniqueKey Name="PrimaryKey" />
<UseForeignKey Name="actor_FK"/>
</RelatedClass>
</ClassMap>
<ClassMap>
<ElementType Name="Movies"/>
<ToClassTable Name="joinmoviesactors"/>
<RelatedClass KeyInParentTable="Foreign">
<ElementType Name="Movie" />
<UseUniqueKey Name="PrimaryKey" />
<UseForeignKey Name="movies_FK"/>
</RelatedClass>
</ClassMap>
<ClassMap>
<ElementType Name="Movie"/>
<ToClassTable Name="movies"/>
<PropertyMap>
<Attribute Name="ID"/>
<ToColumn Name="id"/>
</PropertyMap>
<PropertyMap>
<ElementType Name="Title"/>
<ToColumn Name="title"/>
</PropertyMap>
</ClassMap>
</Maps>
</XMLToDBMS>
===================================================================
Action file:
<Actions Version="2.0"
xmlns="http://www.xmlmiddleware.org/xmldbms/actions/v2">
<DefaultAction>
<Insert />
</DefaultAction>
<Action>
<ElementType Name="Movie"/>
<SoftInsert/>
</Action>
</Actions>
Thanks,
-Jay
________________________________
From: xml-dbms@yahoogroups.com [mailto:xml-dbms@yahoogroups.com] On
Behalf Of Ronald Bourret
Sent: Sunday, February 18, 2007 4:29 PM
To: xml-dbms@yahoogroups.com
Subject: Re: [xml-dbms] Need help on Mapping language.
No. To do this, you would need to use XSLT to transform the document
first. You would then map the transformed document to the database. In
your case, you would need to transform the document to the following:
<results>
<TableOne>
<id> 1 </id>
<data/>
</TableOne>
<TableTwo>
<id> 1 </id>
<data/>
</TableTwo>
</results>
Using XSLT with XML-DBMS is a fairly common occurrence. As a general
rule, the structure of the XML document needs to "match" the structure
of the database schema.
Note that you are also trying to do something else that is not supported
by XML-DBMS. In particular, the id element is a sibling of the table
elements. Elements mapped to columns must be children (or in some cases,
descendants) of elements mapped to tables.
-- Ron
P.S. I believe some commercial software, such as HiT Allora, can do what
you ask for.
Janardhan, Jay wrote:
> Thanks for the reply Ron.
>
>
>
> I'm switching to Java V2.0. While I start experimenting with V2.0, I
> have a quick question. Is it possible to map an element from the XML
> file to columns in different tables?
>
>
>
> For example,
>
>
>
> <results>
>
> <id> 1 </id>
>
> <TableOne>
>
> <data/>
>
> </TableOne>
>
> <TableTwo>
>
> <data/>
>
> </TableTwo>
>
> </results>
>
>
>
> Table: TableOne
>
> ID NOT NULL,
>
> Column1
>
> Coulmn2
>
>
>
> Table: TableTwo
>
> ID NOT NULL,
>
> Column1
>
>
>
> In this example, is it possible to map <id> (from the XML file) to
> TableOne::ID and TableTwo::ID?
>
> Appreciate your assistance.
>
> Thanks,
>
> -Jay
[Non-text portions of this message have been removed]
The VTD-XML project team is proud to announce the release of
version 2.0 of VTD-XML, the next generation XML parser/indexer.
The new features introduced in this version are:
* VTD+XML version 1.0: the world's first true native XML index
that is simple, general-purpose and back-compatible with XML.
* NodeRecorder Class that saves VTDNav's cursor location for
later sequential access.
* Overwrite capability
* Lexically comparisons between VTD and strings
To download the software, please go to
http://sourceforge.net/project/showfiles.php?group_id=110612
To read the latest benchmark report please go to
http://vtd-xml.sf.net/benchmark1.html
To get the latest API overview
http://www.ximpleware.com/vtd-xml_intro.pdf
You can't.
In XML, an ampersand is used as the first character of an entity
reference. If the & is not converted to &, the XML parser will
return an error when it parses the XML document.
Ravikiran wrote:
> I am marshalling a java object into xml file.In the java
> object i am setting a url which consists of & in it,after marshalling
> through JAXP parser it converts into &.Can anyone help me in this
> regard to stop conversion of & to &.
I am marshalling a java object into xml file.In the java
object i am setting a url which consists of & in it,after marshalling
through JAXP parser it converts into &.Can anyone help me in this
regard to stop conversion of & to &.
No. To do this, you would need to use XSLT to transform the document
first. You would then map the transformed document to the database. In
your case, you would need to transform the document to the following:
<results>
<TableOne>
<id> 1 </id>
<data/>
</TableOne>
<TableTwo>
<id> 1 </id>
<data/>
</TableTwo>
</results>
Using XSLT with XML-DBMS is a fairly common occurrence. As a general
rule, the structure of the XML document needs to "match" the structure
of the database schema.
Note that you are also trying to do something else that is not supported
by XML-DBMS. In particular, the id element is a sibling of the table
elements. Elements mapped to columns must be children (or in some cases,
descendants) of elements mapped to tables.
-- Ron
P.S. I believe some commercial software, such as HiT Allora, can do what
you ask for.
Janardhan, Jay wrote:
> Thanks for the reply Ron.
>
>
>
> I'm switching to Java V2.0. While I start experimenting with V2.0, I
> have a quick question. Is it possible to map an element from the XML
> file to columns in different tables?
>
>
>
> For example,
>
>
>
> <results>
>
> <id> 1 </id>
>
> <TableOne>
>
> <data/>
>
> </TableOne>
>
> <TableTwo>
>
> <data/>
>
> </TableTwo>
>
> </results>
>
>
>
> Table: TableOne
>
> ID NOT NULL,
>
> Column1
>
> Coulmn2
>
>
>
> Table: TableTwo
>
> ID NOT NULL,
>
> Column1
>
>
>
> In this example, is it possible to map <id> (from the XML file) to
> TableOne::ID and TableTwo::ID?
>
> Appreciate your assistance.
>
> Thanks,
>
> -Jay
Thanks for the reply Ron.
I'm switching to Java V2.0. While I start experimenting with V2.0, I
have a quick question. Is it possible to map an element from the XML
file to columns in different tables?
For example,
<results>
<id> 1 </id>
<TableOne>
<data/>
</TableOne>
<TableTwo>
<data/>
</TableTwo>
</results>
Table: TableOne
ID NOT NULL,
Column1
Coulmn2
Table: TableTwo
ID NOT NULL,
Column1
In this example, is it possible to map <id> (from the XML file) to
TableOne::ID and TableTwo::ID?
Appreciate your assistance.
Thanks,
-Jay
________________________________
From: xml-dbms@yahoogroups.com [mailto:xml-dbms@yahoogroups.com] On
Behalf Of Ronald Bourret
Sent: Friday, February 16, 2007 10:55 PM
To: xml-dbms@yahoogroups.com
Subject: Re: [xml-dbms] Need help on Mapping language.
Hello,
You are requesting two features that have limited or no support:
1) Insert data into the data_source table only if it does not already
exist. This is supported only in version 2.0 (Java only) through action
documents. In this case, you would specify the soft insert action for
the <data_source> element type.
(I'm actually not sure if a soft insert will work. It depends on the
insert failing due to a primary / unique key error. Since the source_id
-- which I assume is the key -- is not in the XML document, there is no
reason for the insert to fail. However, if source_id is a
database-generated key and the combination of os/version is declared to
be a unique key, then soft insert should work, since attempting to
insert the same os/version will cause a unique key error.)
2) If the data source exists in the database, retrieve the value of the
source_id column and insert it into the data column. This is not
supported in any version of XML-DBMS. (On soft inserts, this value needs
to be in the XML document. This is the case when the key is not
generated by the database.)
Unfortunately, I can't think of any easy workarounds for this. You could
always modify the code, but if your XML really is as simple as you show
here, it would be much faster to write a custom application to do the
inserts.
-- Ron
Jay Janardhan wrote:
> Hi Folks!
>
> My Input XML:
> <data>
> <key>1</<key>
> <data_source>
> <os>AIX</os>
> <version>5.2</version>
> </data_source>
> </data>
>
> Database has two tables:
> Table: data
> -------
> | data |
> -------
> key INT
> source_id INT
>
> Table: data_source
> --------------
> | data_source |
> --------------
> source_id INT
> os VARCHAR
> version VARCAHR
>
>
> Goal is to insert data into the data_source table only if the matching
> "os" and "version" doesn't exist in the data_source table and the
> corresponding source_id should also get inserted into "data:key". If
> "os" and "version" are already present in the "data_source" then it
> should simply take data_source::source_id and insert it into data::key
> column.
>
>
> Could anybody help me to write this mapping please? I'm using the perl
> implementation (version 1.x).
> Appreciate any help.
> Thanks,
> -Jay
>
>
>
>
>
>
>
> To post a message, send it to: xml-dbms@yahoogroups.com
<mailto:xml-dbms%40yahoogroups.com>
> To unsubscribe, send a blank message to:
xml-dbms-unsubscribe@yahoogroups.com
<mailto:xml-dbms-unsubscribe%40yahoogroups.com>
> Yahoo! Groups Links
>
>
>
>
>
[Non-text portions of this message have been removed]
Hello,
You are requesting two features that have limited or no support:
1) Insert data into the data_source table only if it does not already
exist. This is supported only in version 2.0 (Java only) through action
documents. In this case, you would specify the soft insert action for
the <data_source> element type.
(I'm actually not sure if a soft insert will work. It depends on the
insert failing due to a primary / unique key error. Since the source_id
-- which I assume is the key -- is not in the XML document, there is no
reason for the insert to fail. However, if source_id is a
database-generated key and the combination of os/version is declared to
be a unique key, then soft insert should work, since attempting to
insert the same os/version will cause a unique key error.)
2) If the data source exists in the database, retrieve the value of the
source_id column and insert it into the data column. This is not
supported in any version of XML-DBMS. (On soft inserts, this value needs
to be in the XML document. This is the case when the key is not
generated by the database.)
Unfortunately, I can't think of any easy workarounds for this. You could
always modify the code, but if your XML really is as simple as you show
here, it would be much faster to write a custom application to do the
inserts.
-- Ron
Jay Janardhan wrote:
> Hi Folks!
>
> My Input XML:
> <data>
> <key>1</<key>
> <data_source>
> <os>AIX</os>
> <version>5.2</version>
> </data_source>
> </data>
>
> Database has two tables:
> Table: data
> -------
> | data |
> -------
> key INT
> source_id INT
>
> Table: data_source
> --------------
> | data_source |
> --------------
> source_id INT
> os VARCHAR
> version VARCAHR
>
>
> Goal is to insert data into the data_source table only if the matching
> "os" and "version" doesn't exist in the data_source table and the
> corresponding source_id should also get inserted into "data:key". If
> "os" and "version" are already present in the "data_source" then it
> should simply take data_source::source_id and insert it into data::key
> column.
>
>
> Could anybody help me to write this mapping please? I'm using the perl
> implementation (version 1.x).
> Appreciate any help.
> Thanks,
> -Jay
>
>
>
>
>
>
>
> To post a message, send it to: xml-dbms@yahoogroups.com
> To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
Oops!
I meant the "data_source::source_id" should get inserted into
"data::source_id" not into "data::key".
Sorry.
________________________________
From: xml-dbms@yahoogroups.com [mailto:xml-dbms@yahoogroups.com] On
Behalf Of Jay Janardhan
Sent: Friday, February 16, 2007 10:47 AM
To: xml-dbms@yahoogroups.com
Subject: [xml-dbms] Need help on Mapping language.
Hi Folks!
My Input XML:
<data>
<key>1</<key>
<data_source>
<os>AIX</os>
<version>5.2</version>
</data_source>
</data>
Database has two tables:
Table: data
-------
| data |
-------
key INT
source_id INT
Table: data_source
--------------
| data_source |
--------------
source_id INT
os VARCHAR
version VARCAHR
Goal is to insert data into the data_source table only if the matching
"os" and "version" doesn't exist in the data_source table and the
corresponding source_id should also get inserted into "data:key". If
"os" and "version" are already present in the "data_source" then it
should simply take data_source::source_id and insert it into data::key
column.
Could anybody help me to write this mapping please? I'm using the perl
implementation (version 1.x).
Appreciate any help.
Thanks,
-Jay
[Non-text portions of this message have been removed]
Hi Folks!
My Input XML:
<data>
<key>1</<key>
<data_source>
<os>AIX</os>
<version>5.2</version>
</data_source>
</data>
Database has two tables:
Table: data
-------
| data |
-------
key INT
source_id INT
Table: data_source
--------------
| data_source |
--------------
source_id INT
os VARCHAR
version VARCAHR
Goal is to insert data into the data_source table only if the matching
"os" and "version" doesn't exist in the data_source table and the
corresponding source_id should also get inserted into "data:key". If
"os" and "version" are already present in the "data_source" then it
should simply take data_source::source_id and insert it into data::key
column.
Could anybody help me to write this mapping please? I'm using the perl
implementation (version 1.x).
Appreciate any help.
Thanks,
-Jay
Hello,
I haven't gotten back sooner because you already had a work-around.
I tried to duplicate this on my machine, but was not able to do so. In
particular, I was able to construct a map that used unique keys instead
of primary keys in RelatedClass elements.
I then looked back at your original email and was not able to find
anything blatantly wrong.
I then checked the code. The error is coming from the xmldbms.maps.Key
class. There are three different methods that return this error and all
are called by the MapCompiler class. It's not clear which one is causing
the error, as your stack trace doesn't show this.
At this point, there's not much else I can do. If you do recreate this
bug, please send me your map file and the full error stack so I can see
if there is a problem in the map files or in the code.
-- Ron
tarbster wrote:
> Thanks Ron,
>
> As I was in a bit of a hurry, I ended up refactoring some of the
> database tables so that I could use primary / foreign keys in the
> normal way. I didn't keep a copy of my original set of map file
> changes, so my memory of things-as-they-were is a little hazy! What it
> boiled down to (forgetting the "multiple parents" issue, which was
> really a side issue) is that I originally set out to model a
> parent-child relationship in the map file, using <ForeignKey> and
> <RelatedClass> but I ran into problems because the column in the
> parent table that was used as the foreign key wasn't the primary key
> in the parent table. To get around this, I tried specifying it as a
> <UniqueKey> but having done that, I got the error message that I reported.
>
> So in a nutshell... what I was unable to do was to define a FK
> relationship between two elements / tables where the column in the
> parent table used for the join was not the PK.
>
> To answer your question about what was happening at the time I got the
> error... I'm not a Java guy, but a colleague tells me that it was
> during our initialisation phase, where the map files are read and we
> are trying to create the "map objects", the in-memory version of the
> map files. Hope that makes sense...
>
> Regards,
> Nick
Thanks Ron,
As I was in a bit of a hurry, I ended up refactoring some of the
database tables so that I could use primary / foreign keys in the
normal way. I didn't keep a copy of my original set of map file
changes, so my memory of things-as-they-were is a little hazy! What it
boiled down to (forgetting the "multiple parents" issue, which was
really a side issue) is that I originally set out to model a
parent-child relationship in the map file, using <ForeignKey> and
<RelatedClass> but I ran into problems because the column in the
parent table that was used as the foreign key wasn't the primary key
in the parent table. To get around this, I tried specifying it as a
<UniqueKey> but having done that, I got the error message that I reported.
So in a nutshell... what I was unable to do was to define a FK
relationship between two elements / tables where the column in the
parent table used for the join was not the PK.
To answer your question about what was happening at the time I got the
error... I'm not a Java guy, but a colleague tells me that it was
during our initialisation phase, where the map files are read and we
are trying to create the "map objects", the in-memory version of the
map files. Hope that makes sense...
Regards,
Nick
--- In xml-dbms@yahoogroups.com, Ronald Bourret <rpbourret@...> wrote:
>
> Hello,
>
> I've been trying to recreate your problem here and I realized I don't
> understand the structure of your map file. For example, are there three
> ClassMaps for t1, t2, and t3, each of which points to the ClassMap for
> t4? Is there another ClassMap that points to t1, t2, t3? etc.
>
> Could you send me your map file privately, or post a simplified version
> to the list?
>
> Also, did this error occur when transferring data from the document to
> the database or from the database to the document? If going from the
> document to the database, what actions were you using (insert, soft
> insert, etc.)?
>
> It would also help if you could explain what kind of data you are
using.
> This isn't strictly necessary, but helps me visualize what your
database
> is modeling and therefore understand how everything fits together.
>
> By the way, I can't see anything wrong with what you've done so far.
>
> Thanks,
>
> -- Ron
Hello,
I've been trying to recreate your problem here and I realized I don't
understand the structure of your map file. For example, are there three
ClassMaps for t1, t2, and t3, each of which points to the ClassMap for
t4? Is there another ClassMap that points to t1, t2, t3? etc.
Could you send me your map file privately, or post a simplified version
to the list?
Also, did this error occur when transferring data from the document to
the database or from the database to the document? If going from the
document to the database, what actions were you using (insert, soft
insert, etc.)?
It would also help if you could explain what kind of data you are using.
This isn't strictly necessary, but helps me visualize what your database
is modeling and therefore understand how everything fits together.
By the way, I can't see anything wrong with what you've done so far.
Thanks,
-- Ron
tarbster wrote:
> Hi all,
>
> I'm getting this error:
>
> "2007-01-16 15:57:50,978 ERROR [RequestProcessor-20]
> persistencelayer.DataRequestCompiler (DataRequestCompiler.java:211) -
> This method may only be called for foreign keys."
>
> It's a result of some changes I recently made to my map file, and I'm
> wondering if it's actually possible to do what I'm trying to do...
> xmldbms2.dtd seems to say that it is, but the error makes me uncertain.
>
> The situation I have is that there are three database tables
> (t1,t2,t3) that can all be the parent of the same child table (t4).
> The FK relationships are:
>
> t1.column_1 -> t4.column_1
> t2.column_1 -> t4.column_2
> t3.column_1 -> t4.column_3
>
> I've been able to set up the foreign key relationship in my Oracle DB,
> but I'm struggling with the map file. The thing that makes it
> different from the norm is that the columns in t1,t2 and t3 are NOT
> the primary keys for those tables... they're just regular columns.
> This being the case, I've added unique keys to the <Table> elements
> for the parent tables, like this:
>
> <UniqueKey Name="dsplu_u1">
> <UseColumn Name="SCHEMPINLIST"/>
> </UniqueKey>
>
> ...and I've added <RelatedClass> elements to their classmaps, like this:
>
> <RelatedClass KeyInParentTable="Unique">
> <ElementType Name="schemzone"/>
> <UseUniqueKey Name="dsplu_u1"/>
> <UseForeignKey Name="SCHEMZONEKEY_FK1"/>
> </RelatedClass>
>
> ...and I've added corresponding foreign keys to the child table, like
> this:
>
> <ForeignKey Name="SCHEMZONEKEY_FK1">
> <UseTable Name="DESIGNSHAREDPINLISTUSAGE"/>
> <UseUniqueKey Name="dsplu_u1"/>
> <UseColumn Name="SCHEMPINLIST"/>
> </ForeignKey>
>
> ...but I'm getting this error. Is it possible to achieve what I'm
> trying to achieve, and am I going about it the wrong way?
>
> TIA
> Nick
Hi all
I am Mani, Working as a software engineer, as well as I'm doing PhD, Topic
is XMLDatamangement. If any one give the suggetions and which topic is good for
me.
Thank U
________________________________________________________________________________\
____
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
[Non-text portions of this message have been removed]
Hi all,
I'm getting this error:
"2007-01-16 15:57:50,978 ERROR [RequestProcessor-20]
persistencelayer.DataRequestCompiler (DataRequestCompiler.java:211) -
This method may only be called for foreign keys."
It's a result of some changes I recently made to my map file, and I'm
wondering if it's actually possible to do what I'm trying to do...
xmldbms2.dtd seems to say that it is, but the error makes me uncertain.
The situation I have is that there are three database tables
(t1,t2,t3) that can all be the parent of the same child table (t4).
The FK relationships are:
t1.column_1 -> t4.column_1
t2.column_1 -> t4.column_2
t3.column_1 -> t4.column_3
I've been able to set up the foreign key relationship in my Oracle DB,
but I'm struggling with the map file. The thing that makes it
different from the norm is that the columns in t1,t2 and t3 are NOT
the primary keys for those tables... they're just regular columns.
This being the case, I've added unique keys to the <Table> elements
for the parent tables, like this:
<UniqueKey Name="dsplu_u1">
<UseColumn Name="SCHEMPINLIST"/>
</UniqueKey>
...and I've added <RelatedClass> elements to their classmaps, like this:
<RelatedClass KeyInParentTable="Unique">
<ElementType Name="schemzone"/>
<UseUniqueKey Name="dsplu_u1"/>
<UseForeignKey Name="SCHEMZONEKEY_FK1"/>
</RelatedClass>
...and I've added corresponding foreign keys to the child table, like
this:
<ForeignKey Name="SCHEMZONEKEY_FK1">
<UseTable Name="DESIGNSHAREDPINLISTUSAGE"/>
<UseUniqueKey Name="dsplu_u1"/>
<UseColumn Name="SCHEMPINLIST"/>
</ForeignKey>
...but I'm getting this error. Is it possible to achieve what I'm
trying to achieve, and am I going about it the wrong way?
TIA
Nick
Sounds good. You get the added advantage of all the 2.0 features as well
-- updates, deletes, soft inserts, etc.
-- Ron
Chris Van Oosbree wrote:
> Thanks for the reply. I did try messing around with the Perl code to see if I
could change it such that it would retrieve the insertid and use it. I didn't
have much luck though. I think my best bet will be to use the newer Java
version as you suggested.
>
> Thanks,
> Chris
Thanks for the reply. I did try messing around with the Perl code to see if I
could change it such that it would retrieve the insertid and use it. I didn't
have much luck though. I think my best bet will be to use the newer Java
version as you suggested.
Thanks,
Chris
----- Original Message ----
From: Ronald Bourret <rpbourret@...>
To: xml-dbms@yahoogroups.com
Sent: Wednesday, November 29, 2006 10:54:42 PM
Subject: Re: [xml-dbms] duplicate entry error with Mysql
Hello,
Sorry it took so long for me to reply. Deadlines, deadlines, deadlines...
I also looked at the generateKey subroutine. One thing I don't
understand is where it updates the table so that each subsequent call to
generateKey gets a different value. Then again, I don't understand PERL,
so the following line makes no sense to me:
$newValue = ' 'x(length($maxValue )-length( $newValue) ) . $newValue;
In any case, you have several options:
a) Rewrite the code in generateKey so that both reading the table and
updating it are enclosed in a single transaction. Even if you do this,
I'm not entirely convinced that it will work. Depending on how the
database implements transactions around select statements, it seems
possible that two calling applications could both read the same result
-- the first read might not lock the table -- but have their updates
correctly serialized.
b) Replace generateKey with code to use a different key generation
mechanism. For example, you could get the current system time, cast it
as a string, and generate an integer hash code from the string to get a
unique key. (This might not work, as two separate processes could
conceivably retrieve the same time. You could solve this by adding
something else to the string, such as a process ID, before computing the
hash code.)
c) Use the Java XML-DBMS 2.0, which supports keys generated by the
database, such as MySQL's AUTO_INCREMENT columns.
d) Modify the PERL version of XML-DBMS 1.x to use MySQL's AUTO_INCREMENT
columns. Note that at least one DBI driver for PERL does support
retrieving AUTO_INCREMENT values [1]. I'm not sure how difficult this
would be, as I haven't looked at the Java XML-DBMS 1.x code in a long
time and haven't ever looked closely at the PERL code.
I'm guessing that you would need to modify the insertRow subroutine to
immediately retrieve the AUTO_INCREMENT value with the mysql_insertid
method, then place this in the $row object. I'm guessing that the rest
of the code would then correctly retrieve the value from the $row object
and use it when linking to other rows. Obviously, you would need to
check the code to see if this happens.
Hope this helps,
-- Ron
[1] http://mysqld. active-venture. com/Perl_ DBI_Class. html
Chris Van Oosbree wrote:
> Yes, I am running the parsers in parallel by just having
> multiple processes run in parallel. No multi-threading
> or anything like that.
>
> Also, yes, I am asking XML-DBMS to generate the keys for me.
> I did look at the Perl module and I think I see that the issue
> is indeed caused by this. I'll elaborate.
>
> The key generation algorithm looks like it just does a lookup
> of the max ID currently in a table, and the next available ID
> would be the key it generates. Here are a few lines of code
> from the generateKey subroutine:
>
> my $selectString = "select max($columnName) from $tableName";
> my $maxValue = $self->{DBh} ->selectrow_ array($selectStr ing);
> my $newValue = $maxValue + 1;
>
> The problem I'm having occurs when two processes both look at
> the same table and see the same max ID and come up with the
> same next key value and try to insert that row at more or less
> the same time, hence the duplicate key error.
>
> I have all my tables in MySQL setup to have auto-incrementing
> keys, so I guess I don't really need the code to generate the
> keys for me. But when a parent element is inserted I need the
> code to get the ID for the row that was just inserted so it can
> put that in as a foreign key in the child elements. Can the 1.x
> version of XML-DBMS do this? I see a feature for 2.0 called
> "database-generated keys". Is this what I'm looking for?
>
> Thanks for your help!
> Chris
>
>
> ----- Original Message ----
> From: Ronald Bourret <rpbourret@rpbourret .com>
> To: xml-dbms@yahoogroup s.com
> Sent: Friday, November 17, 2006 4:25:23 PM
> Subject: Re: [xml-dbms] duplicate entry error with Mysql
>
> Hello,
>
> First, I didn't write the Perl version of the code and I don't think the
> author is on this list any more. So I'll try to help, but might not be
> able to answer your question.
>
> How are you running multiple parsers? Are these separate processes, each
> of which is calling the Perl version of XML-DBMS as a separate instance?
> Or are you trying to use multi-threading to run multiple threads through
> the same instance of XML-DBMS?
>
> If you are using multi-threading, I suspect you will have problems. The
> Java version of XML-DBMS is not designed for multi-threading and I would
> be very surprised if the Perl version supported multi-threading.
>
> My other question is whether your map document tells XML-DBMS to
> generate keys. This strikes me as the most likely cause of the problem,
> although I will need to look into the code as to how exactly this might
> be happening.
>
> -- Ron
>
> clonefan98 wrote:
>
>
>>Hi,
>>
>>I'm trying to use the XML-DBMS package to parse several thousand XML
>>files into a database. I'd like to be able to run more than one
>>instance of the parser at once, but I am running into problems.
>>
>>I am using the Perl version of XML-DBMS (I don't know Java) and MySQL
>>version 5.0.26.
>>
>>What is happening is that when I run more than one instance of the
>>parser I eventually run into duplicate key errors. Here is an
>>example of one of the errors:
>>Duplicate entry '9740' for key 1 at ./XmlRetrieve. pl line 36
>>
>>If I run only one parser over the same set of files it works fine, I
>>only run into this when I have more than one running at a time. So
>>there seems to be some contention between the multiple instances.
>>And it doesn't fail in the same place every time. It seems to me
>>that it's random chance if one of the instances get its "toes stepped
>>on" so to speak and errors out.
>>
>>Do you have any ideas? Let me know if there is any other info you
>>need.
>
>
>
>
>
>
>
> ____________ _________ _________ _________ _________ _________ _
> Sponsored Link
>
> Mortgage rates near 39yr lows.
> $420k for $1,399/mo. Calculate new payment!
> www.LowerMyBills. com/lre
>
> [Non-text portions of this message have been removed]
>
>
>
> To post a message, send it to: xml-dbms@yahoogroup s.com
> To unsubscribe, send a blank message to: xml-dbms-unsubscrib e@yahoogroups.
com
> Yahoo! Groups Links
>
>
>
>
>
>
________________________________________________________________________________\
____
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
[Non-text portions of this message have been removed]
Hello,
Sorry about the late reply. I was busy with other work.
I looked at the code and it might not be too difficult to modify the
code to do this. Here's what appears to be necessary:
a) Modify the filter DTD:
i) Add the OrderColumn element from the XML-DBMS 2.0 (mapping) DTD.
ii) Modify RootFilter to accept an optional OrderColumn element:
<!ELEMENT %p;RootFilter (%p;Table, %p;Where+, %p;OrderColumn?)>
b) Modify RootFilter to include an orderInfo property of class
org.xmlmiddleware.xmldbms.maps.OrderInfo. Initialize this to null. Add
getOrderInfo and setOrderInfo methods.
c) Modify FilterCompiler to look for the OrderColumn element and call
RootFilter.setOrderInfo if it is found.
d) Modify the DBMSToDOM.retrieveRootTableData property to call
RootFilter.getOrderInfo:
...
// Get the root table and the map for it.
rootConditions = rootFilter.getRootFilterConditions();
rootTable = rootConditions.getTable();
rootTableMap = map.getClassTableMap(rootTable);
// NEW CODE
OrderInfo orderInfo = rootFilter.getOrderInfo();
e) Use the orderInfo variable in the call to DataHandler.select:
// Construct a result set based on the filter conditions and
process it.
// OLD CODE
// rs = dataHandler.select(rootTable, null, null, where, columns,
params, null);
// Construct a result set based on the filter conditions and
process it.
// NEW CODE
rs = dataHandler.select(rootTable, null, null, where, columns,
params, orderInfo);
This code is not compiled or tested, but it looks like it should work.
Let me know if you have problems.
-- Ron
Ronald Bourret wrote:
> The quick answer to this is that I don't think it's currently supported
> at the top level. (It is possible to support ordering for nested
> elements, such as ordering line items inside a sales order like in the
> sample.)
>
> I'll need to look at the code more deeply to verify that (a) this isn't
> currently supported and (b) how difficult it would be to add support.
>
> -- Ron
>
> Sami Ather wrote:
>
>
>>I have a filter like
>><FilterSet Version="2.0"
>>xmlns="http://www.xmlmiddleware.org/xmldbms/filters/v2">
>> <Options>
>> <Namespace Prefix="tes" URI = "http://www.tes.com/" />
>> <Wrapper Name="tes:Transactions" />
>> </Options>
>> <Filters>
>> <Filter>
>> <RootFilter>
>> <Table Name="Transaction"/>
>> <Where Condition="fundID=1"/>
>> </RootFilter>
>> </Filter>
>> </Filters>
>></FilterSet>
>>
>>This filter issues an sql statement like
>>SELECT * from transaction where fundID=1
>>how should I go about creating a filter which issues a statement like
>>SELECT * from transaction where fundID=1 ORDER BY transactionDate DESC
>>
>>Currently my map file looks like
>><XMLToDBMS Version="2.0" xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
>>
>> <Databases>
>> <Database Name="Default">
>> <Catalog>
>> <Schema>
>> <Table Name="Transaction">
>> <Column Name="transactionID" DataType="INTEGER" Nullable="No"/>
>> <Column Name="transactionAmount" DataType="INTEGER" Nullable="No"/>
>> <Column Name="transactionDate" DataType="TIMESTAMP" Length="50"
>>Nullable="No"/>
>> <Column Name="transactionTypeID" DataType="INTEGER" Nullable="No"/>
>> <Column Name="fundID" DataType="INTEGER" Nullable="No"/>
>> <PrimaryKey KeyGenerator="Database">
>> <UseColumn Name="transactionID"/>
>> </PrimaryKey>
>> </Table>
>> </Schema>
>> </Catalog>
>> </Database>
>> </Databases>
>> <Maps>
>> <ClassMap>
>> <ElementType Name="Transaction"/>
>> <ToClassTable Name="Transaction"/>
>> <PropertyMap>
>> <Attribute Name="transactionID"/>
>> <ToColumn Name="transactionID"/>
>> </PropertyMap>
>> <PropertyMap>
>> <ElementType Name="transactionAmount"/>
>> <ToColumn Name="transactionAmount"/>
>> </PropertyMap>
>> <PropertyMap>
>> <ElementType Name="transactionDate"/>
>> <ToColumn Name="transactionDate"/>
>> </PropertyMap>
>> <PropertyMap>
>> <ElementType Name="transactionTypeID"/>
>> <ToColumn Name="transactionTypeID"/>
>> </PropertyMap>
>> <PropertyMap>
>> <ElementType Name="fundID"/>
>> <ToColumn Name="fundID"/>
>> </PropertyMap>
>> </ClassMap>
>> </Maps>
>></XMLToDBMS>
>>
>>I will appeciate your answer
>
>
>
>
> To post a message, send it to: xml-dbms@yahoogroups.com
> To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
Hello,
Sorry it took so long for me to reply. Deadlines, deadlines, deadlines...
I also looked at the generateKey subroutine. One thing I don't
understand is where it updates the table so that each subsequent call to
generateKey gets a different value. Then again, I don't understand PERL,
so the following line makes no sense to me:
$newValue = ' 'x(length($maxValue)-length($newValue)) . $newValue;
In any case, you have several options:
a) Rewrite the code in generateKey so that both reading the table and
updating it are enclosed in a single transaction. Even if you do this,
I'm not entirely convinced that it will work. Depending on how the
database implements transactions around select statements, it seems
possible that two calling applications could both read the same result
-- the first read might not lock the table -- but have their updates
correctly serialized.
b) Replace generateKey with code to use a different key generation
mechanism. For example, you could get the current system time, cast it
as a string, and generate an integer hash code from the string to get a
unique key. (This might not work, as two separate processes could
conceivably retrieve the same time. You could solve this by adding
something else to the string, such as a process ID, before computing the
hash code.)
c) Use the Java XML-DBMS 2.0, which supports keys generated by the
database, such as MySQL's AUTO_INCREMENT columns.
d) Modify the PERL version of XML-DBMS 1.x to use MySQL's AUTO_INCREMENT
columns. Note that at least one DBI driver for PERL does support
retrieving AUTO_INCREMENT values [1]. I'm not sure how difficult this
would be, as I haven't looked at the Java XML-DBMS 1.x code in a long
time and haven't ever looked closely at the PERL code.
I'm guessing that you would need to modify the insertRow subroutine to
immediately retrieve the AUTO_INCREMENT value with the mysql_insertid
method, then place this in the $row object. I'm guessing that the rest
of the code would then correctly retrieve the value from the $row object
and use it when linking to other rows. Obviously, you would need to
check the code to see if this happens.
Hope this helps,
-- Ron
[1] http://mysqld.active-venture.com/Perl_DBI_Class.html
Chris Van Oosbree wrote:
> Yes, I am running the parsers in parallel by just having
> multiple processes run in parallel. No multi-threading
> or anything like that.
>
> Also, yes, I am asking XML-DBMS to generate the keys for me.
> I did look at the Perl module and I think I see that the issue
> is indeed caused by this. I'll elaborate.
>
> The key generation algorithm looks like it just does a lookup
> of the max ID currently in a table, and the next available ID
> would be the key it generates. Here are a few lines of code
> from the generateKey subroutine:
>
> my $selectString = "select max($columnName) from $tableName";
> my $maxValue = $self->{DBh}->selectrow_array($selectString);
> my $newValue = $maxValue + 1;
>
> The problem I'm having occurs when two processes both look at
> the same table and see the same max ID and come up with the
> same next key value and try to insert that row at more or less
> the same time, hence the duplicate key error.
>
> I have all my tables in MySQL setup to have auto-incrementing
> keys, so I guess I don't really need the code to generate the
> keys for me. But when a parent element is inserted I need the
> code to get the ID for the row that was just inserted so it can
> put that in as a foreign key in the child elements. Can the 1.x
> version of XML-DBMS do this? I see a feature for 2.0 called
> "database-generated keys". Is this what I'm looking for?
>
> Thanks for your help!
> Chris
>
>
> ----- Original Message ----
> From: Ronald Bourret <rpbourret@...>
> To: xml-dbms@yahoogroups.com
> Sent: Friday, November 17, 2006 4:25:23 PM
> Subject: Re: [xml-dbms] duplicate entry error with Mysql
>
> Hello,
>
> First, I didn't write the Perl version of the code and I don't think the
> author is on this list any more. So I'll try to help, but might not be
> able to answer your question.
>
> How are you running multiple parsers? Are these separate processes, each
> of which is calling the Perl version of XML-DBMS as a separate instance?
> Or are you trying to use multi-threading to run multiple threads through
> the same instance of XML-DBMS?
>
> If you are using multi-threading, I suspect you will have problems. The
> Java version of XML-DBMS is not designed for multi-threading and I would
> be very surprised if the Perl version supported multi-threading.
>
> My other question is whether your map document tells XML-DBMS to
> generate keys. This strikes me as the most likely cause of the problem,
> although I will need to look into the code as to how exactly this might
> be happening.
>
> -- Ron
>
> clonefan98 wrote:
>
>
>>Hi,
>>
>>I'm trying to use the XML-DBMS package to parse several thousand XML
>>files into a database. I'd like to be able to run more than one
>>instance of the parser at once, but I am running into problems.
>>
>>I am using the Perl version of XML-DBMS (I don't know Java) and MySQL
>>version 5.0.26.
>>
>>What is happening is that when I run more than one instance of the
>>parser I eventually run into duplicate key errors. Here is an
>>example of one of the errors:
>>Duplicate entry '9740' for key 1 at ./XmlRetrieve. pl line 36
>>
>>If I run only one parser over the same set of files it works fine, I
>>only run into this when I have more than one running at a time. So
>>there seems to be some contention between the multiple instances.
>>And it doesn't fail in the same place every time. It seems to me
>>that it's random chance if one of the instances get its "toes stepped
>>on" so to speak and errors out.
>>
>>Do you have any ideas? Let me know if there is any other info you
>>need.
>
>
>
>
>
>
>
>
________________________________________________________________________________\
____
> Sponsored Link
>
> Mortgage rates near 39yr lows.
> $420k for $1,399/mo. Calculate new payment!
> www.LowerMyBills.com/lre
>
> [Non-text portions of this message have been removed]
>
>
>
> To post a message, send it to: xml-dbms@yahoogroups.com
> To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
Hello,
Sorry I haven't answered sooner. I've had deadlines on a book I'm
helping write for the last two weeks.
1) As you found out yourself, when a query returns more than one row,
you get a DOM error. The solution to this is to use Wrapper element to
create a root element that "wraps" the other elements. For example, you
could use the following filter document:
<?xml version='1.0' ?>
<!DOCTYPE FilterSet SYSTEM "filters.dtd" >
<FilterSet Version="2.0"
xmlns="http://www.xmlmiddleware.org/xmldbms/filters/v2">
<Options>
<Wrapper Name="Orders" />
</Options>
<Filters>
<Filter>
<RootFilter>
<Table Name="Orders"/>
<Where Condition="Number='123' "/>
</RootFilter>
</Filter>
</Filters>
</FilterSet>
This will create an XML document with a root element named Orders. The
individual Order will be created inside this element.
2) The condition Number < 1000 probably works because the Number field
is a VARCHAR, not a number. (I am not certain about this.)
3) To get all rows in a table, use a condition like:
<Where Condition="0=0"/>
(This is a design bug. You should be able to just omit the Where
element. Oh, well.)
-- Ron
liang_huai wrote:
> Thanks for your reply
>
> We can take the Transfer sample of XML-DBMS binary, I imported the
> default structure and data in a MySQL database, I didn¡¯t modify the
> Orders.map file, the original filter files is:
>
> <?xml version='1.0' ?>
> <!DOCTYPE FilterSet SYSTEM "filters.dtd" >
>
> <FilterSet Version="2.0"
> xmlns="http://www.xmlmiddleware.org/xmldbms/filters/v2">
> <Filters>
> <Filter>
> <RootFilter>
> <Table Name="Orders"/>
> <Where Condition="Number='123' "/>
> </RootFilter>
> </Filter>
> </Filters>
> </FilterSet>
>
> - If I modify the where clause to ¡° Number > ¡®1¡¯ ¡° :
>
> <Where Condition="Number > '1' "/>
>
> - I got a exception below, It¡¯s not because the data type of
> Number is VARCHAR, MySQL accepts ¡°>¡± ¡°<¡± for varchar comparison
> normally, I¡¯ve the same problem for integer type fields.
>
>
> org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made
> to insert a node where it is not permitted.
> at org.apache.xerces.dom.CoreDocumentImpl.insertBefore
> (Unknown Source)
> at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
> at
> org.xmlmiddleware.xmldbms.DBMSToDOM$OrderedNode.insertUnorderedChild
> (DBMSToDOM.java:1254)
> at
> org.xmlmiddleware.xmldbms.DBMSToDOM$OrderedNode.insertChild
> (DBMSToDOM.java:1165)
> at org.xmlmiddleware.xmldbms.DBMSToDOM.processClassResultSet
> (DBMSToDOM.java:397)
> at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveRootTableData
> (DBMSToDOM.java:333)
> at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
> (DBMSToDOM.java:271)
> at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
> (DBMSToDOM.java:185)
> at
> org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocumentInternal
> (Transfer.java:864)
> at org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocument
> (Transfer.java:573)
> at
> org.xmlmiddleware.xmldbms.tools.Transfer.dispatchRetrieveDocumentByFi
> lter(Transfer.java:776)
> at org.xmlmiddleware.xmldbms.tools.Transfer.dispatch
> (Transfer.java:442)
> at org.xmlmiddleware.xmldbms.tools.Transfer.main
> (Transfer.java:353)
>
>
> - It works with ¡° Number < ¡®1000¡¯ (see below), but it only
> retrieves the first element/records but not all the elements with
> order number less than 1000 :
>
> <Where Condition="Number < '1000' "/>
>
>
> - When I removed entirely the Where clause, I got:
>
> java.sql.SQLException: You have an error in your SQL syntax; check
> the manual that corresponds to your MySQL server version for the
> right syntax to use near ')'
> at line 1
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
> at com.mysql.jdbc.Connection.execSQL(Connection.java:3004)
> at com.mysql.jdbc.PreparedStatement.executeInternal
> (PreparedStatement.java:1128)
> at com.mysql.jdbc.PreparedStatement.executeQuery
> (PreparedStatement.java:1222)
> at org.xmlmiddleware.db.SPPreparedStatement.executeQuery
> (SPPreparedStatement.java:77)
> at
> org.xmlmiddleware.xmldbms.datahandlers.DataHandlerBase.select
> (DataHandlerBase.java:290)
> at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveRootTableData
> (DBMSToDOM.java:332)
> at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
> (DBMSToDOM.java:271)
> at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
> (DBMSToDOM.java:185)
> at
> org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocumentInternal
> (Transfer.java:864)
> at org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocument
> (Transfer.java:573)
> at
> org.xmlmiddleware.xmldbms.tools.Transfer.dispatchRetrieveDocumentByFi
> lter(Transfer.java:776)
> at org.xmlmiddleware.xmldbms.tools.Transfer.dispatch
> (Transfer.java:442)
> at org.xmlmiddleware.xmldbms.tools.Transfer.main
> (Transfer.java:353)
>
> - In the MYSQL log, I have:
>
> 11 Query SELECT `Date`, `Number`, `CustNumber` FROM `Orders`
> WHERE ()
>
> Evidently MYSQL doesn¡¯t accept empty where () query, can I control
> that in XML-DBMS when I want to retrieve all data of the whole
> table?
Version 1.8 of VTD-XML is now released. The new features are:
· XMLModifier is a easy to use class that takes advantage of
the incremental update capability offered by VTD-XML
· XPath built-in functions are now almost complete
· This release added encoding support for iso-8859-2~10,
windows code page 1250~1258
· Added various functions to autoPilot that evaluate XPath to
string, number and boolean
· This release also fixes a number of XPath bugs related to
string handling
To download the latest release please visit http://vtd-xml.sf.net
Thanks for your reply
We can take the Transfer sample of XML-DBMS binary, I imported the
default structure and data in a MySQL database, I didn¡¯t modify the
Orders.map file, the original filter files is:
<?xml version='1.0' ?>
<!DOCTYPE FilterSet SYSTEM "filters.dtd" >
<FilterSet Version="2.0"
xmlns="http://www.xmlmiddleware.org/xmldbms/filters/v2">
<Filters>
<Filter>
<RootFilter>
<Table Name="Orders"/>
<Where Condition="Number='123' "/>
</RootFilter>
</Filter>
</Filters>
</FilterSet>
- If I modify the where clause to ¡° Number > ¡®1¡¯ ¡° :
<Where Condition="Number > '1' "/>
- I got a exception below, It¡¯s not because the data type of
Number is VARCHAR, MySQL accepts ¡°>¡± ¡°<¡± for varchar comparison
normally, I¡¯ve the same problem for integer type fields.
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made
to insert a node where it is not permitted.
at org.apache.xerces.dom.CoreDocumentImpl.insertBefore
(Unknown Source)
at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
at
org.xmlmiddleware.xmldbms.DBMSToDOM$OrderedNode.insertUnorderedChild
(DBMSToDOM.java:1254)
at
org.xmlmiddleware.xmldbms.DBMSToDOM$OrderedNode.insertChild
(DBMSToDOM.java:1165)
at org.xmlmiddleware.xmldbms.DBMSToDOM.processClassResultSet
(DBMSToDOM.java:397)
at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveRootTableData
(DBMSToDOM.java:333)
at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
(DBMSToDOM.java:271)
at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
(DBMSToDOM.java:185)
at
org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocumentInternal
(Transfer.java:864)
at org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocument
(Transfer.java:573)
at
org.xmlmiddleware.xmldbms.tools.Transfer.dispatchRetrieveDocumentByFi
lter(Transfer.java:776)
at org.xmlmiddleware.xmldbms.tools.Transfer.dispatch
(Transfer.java:442)
at org.xmlmiddleware.xmldbms.tools.Transfer.main
(Transfer.java:353)
- It works with ¡° Number < ¡®1000¡¯ (see below), but it only
retrieves the first element/records but not all the elements with
order number less than 1000 :
<Where Condition="Number < '1000' "/>
- When I removed entirely the Where clause, I got:
java.sql.SQLException: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the
right syntax to use near ')'
at line 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3004)
at com.mysql.jdbc.PreparedStatement.executeInternal
(PreparedStatement.java:1128)
at com.mysql.jdbc.PreparedStatement.executeQuery
(PreparedStatement.java:1222)
at org.xmlmiddleware.db.SPPreparedStatement.executeQuery
(SPPreparedStatement.java:77)
at
org.xmlmiddleware.xmldbms.datahandlers.DataHandlerBase.select
(DataHandlerBase.java:290)
at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveRootTableData
(DBMSToDOM.java:332)
at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
(DBMSToDOM.java:271)
at org.xmlmiddleware.xmldbms.DBMSToDOM.retrieveDocument
(DBMSToDOM.java:185)
at
org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocumentInternal
(Transfer.java:864)
at org.xmlmiddleware.xmldbms.tools.Transfer.retrieveDocument
(Transfer.java:573)
at
org.xmlmiddleware.xmldbms.tools.Transfer.dispatchRetrieveDocumentByFi
lter(Transfer.java:776)
at org.xmlmiddleware.xmldbms.tools.Transfer.dispatch
(Transfer.java:442)
at org.xmlmiddleware.xmldbms.tools.Transfer.main
(Transfer.java:353)
- In the MYSQL log, I have:
11 Query SELECT `Date`, `Number`, `CustNumber` FROM `Orders`
WHERE ()
Evidently MYSQL doesn¡¯t accept empty where () query, can I control
that in XML-DBMS when I want to retrieve all data of the whole
table?
Thanks
Can you send me:
a) The code you are using to call XML-DBMS.
b) Your map document (if any)
c) Your database schema
If you do not want to post this information to the list, please send it
to me privately at rpbourret@....
Thanks,
-- Ron
liang_huai wrote:
> Hi
>
> I'm trying to use XML-DBMS to transfer data, in most cases I want to
> retrieve data with some conditions likes "where Number > 0 and Number
> < 100" event without "where" conditions, rather than the equal
> expression "where Number = N". but it didn't work when Transfer uses
> filter file with these conditions or without condition. What should I
> do?
>
>
> Filter files is created by FilterCondtion.addCondition then
> FilterSerializer, so normally no conversion problem for the XML
> characters ">" "<"…
Hi
I'm trying to use XML-DBMS to transfer data, in most cases I want to
retrieve data with some conditions likes "where Number > 0 and Number
< 100" event without "where" conditions, rather than the equal
expression "where Number = N". but it didn't work when Transfer uses
filter file with these conditions or without condition. What should I
do?
Filter files is created by FilterCondtion.addCondition then
FilterSerializer, so normally no conversion problem for the XML
characters ">" "<"…
Thanks in advance.
Yes, I am running the parsers in parallel by just having multiple processes run
in parallel. No multi-threading or anything like that.
Also, yes, I am asking XML-DBMS to generate the keys for me. I did look at the
Perl module and I think I see that the issue is indeed caused by this. I'll
elaborate.
The key generation algorithm looks like it just does a lookup of the max ID
currently in a table, and the next available ID would be the key it generates.
Here are a few lines of code from the generateKey subroutine:
my $selectString = "select max($columnName) from $tableName";
my $maxValue = $self->{DBh}->selectrow_array($selectString);
my $newValue = $maxValue + 1;
The problem I'm having occurs when two processes both look at the same table and
see the same max ID and come up with the same next key value and try to insert
that row at more or less the same time, hence the duplicate key error.
I have all my tables in MySQL setup to have auto-incrementing keys, so I guess I
don't really need the code to generate the keys for me. But when a parent
element is inserted I need the code to get the ID for the row that was just
inserted so it can put that in as a foreign key in the child elements. Can the
1.x version of XML-DBMS do this? I see a feature for 2.0 called
"database-generated keys". Is this what I'm looking for?
Thanks for your help!
Chris
----- Original Message ----
From: Ronald Bourret <rpbourret@...>
To: xml-dbms@yahoogroups.com
Sent: Friday, November 17, 2006 4:25:23 PM
Subject: Re: [xml-dbms] duplicate entry error with Mysql
Hello,
First, I didn't write the Perl version of the code and I don't think the
author is on this list any more. So I'll try to help, but might not be
able to answer your question.
How are you running multiple parsers? Are these separate processes, each
of which is calling the Perl version of XML-DBMS as a separate instance?
Or are you trying to use multi-threading to run multiple threads through
the same instance of XML-DBMS?
If you are using multi-threading, I suspect you will have problems. The
Java version of XML-DBMS is not designed for multi-threading and I would
be very surprised if the Perl version supported multi-threading.
My other question is whether your map document tells XML-DBMS to
generate keys. This strikes me as the most likely cause of the problem,
although I will need to look into the code as to how exactly this might
be happening.
-- Ron
clonefan98 wrote:
> Hi,
>
> I'm trying to use the XML-DBMS package to parse several thousand XML
> files into a database. I'd like to be able to run more than one
> instance of the parser at once, but I am running into problems.
>
> I am using the Perl version of XML-DBMS (I don't know Java) and MySQL
> version 5.0.26.
>
> What is happening is that when I run more than one instance of the
> parser I eventually run into duplicate key errors. Here is an
> example of one of the errors:
> Duplicate entry '9740' for key 1 at ./XmlRetrieve. pl line 36
>
> If I run only one parser over the same set of files it works fine, I
> only run into this when I have more than one running at a time. So
> there seems to be some contention between the multiple instances.
> And it doesn't fail in the same place every time. It seems to me
> that it's random chance if one of the instances get its "toes stepped
> on" so to speak and errors out.
>
> Do you have any ideas? Let me know if there is any other info you
> need.
________________________________________________________________________________\
____
Sponsored Link
Mortgage rates near 39yr lows.
$420k for $1,399/mo. Calculate new payment!
www.LowerMyBills.com/lre
[Non-text portions of this message have been removed]
Hello,
First, I didn't write the Perl version of the code and I don't think the
author is on this list any more. So I'll try to help, but might not be
able to answer your question.
How are you running multiple parsers? Are these separate processes, each
of which is calling the Perl version of XML-DBMS as a separate instance?
Or are you trying to use multi-threading to run multiple threads through
the same instance of XML-DBMS?
If you are using multi-threading, I suspect you will have problems. The
Java version of XML-DBMS is not designed for multi-threading and I would
be very surprised if the Perl version supported multi-threading.
My other question is whether your map document tells XML-DBMS to
generate keys. This strikes me as the most likely cause of the problem,
although I will need to look into the code as to how exactly this might
be happening.
-- Ron
clonefan98 wrote:
> Hi,
>
> I'm trying to use the XML-DBMS package to parse several thousand XML
> files into a database. I'd like to be able to run more than one
> instance of the parser at once, but I am running into problems.
>
> I am using the Perl version of XML-DBMS (I don't know Java) and MySQL
> version 5.0.26.
>
> What is happening is that when I run more than one instance of the
> parser I eventually run into duplicate key errors. Here is an
> example of one of the errors:
> Duplicate entry '9740' for key 1 at ./XmlRetrieve.pl line 36
>
> If I run only one parser over the same set of files it works fine, I
> only run into this when I have more than one running at a time. So
> there seems to be some contention between the multiple instances.
> And it doesn't fail in the same place every time. It seems to me
> that it's random chance if one of the instances get its "toes stepped
> on" so to speak and errors out.
>
> Do you have any ideas? Let me know if there is any other info you
> need.
The quick answer to this is that I don't think it's currently supported
at the top level. (It is possible to support ordering for nested
elements, such as ordering line items inside a sales order like in the
sample.)
I'll need to look at the code more deeply to verify that (a) this isn't
currently supported and (b) how difficult it would be to add support.
-- Ron
Sami Ather wrote:
> I have a filter like
> <FilterSet Version="2.0"
> xmlns="http://www.xmlmiddleware.org/xmldbms/filters/v2">
> <Options>
> <Namespace Prefix="tes" URI = "http://www.tes.com/" />
> <Wrapper Name="tes:Transactions" />
> </Options>
> <Filters>
> <Filter>
> <RootFilter>
> <Table Name="Transaction"/>
> <Where Condition="fundID=1"/>
> </RootFilter>
> </Filter>
> </Filters>
> </FilterSet>
>
> This filter issues an sql statement like
> SELECT * from transaction where fundID=1
> how should I go about creating a filter which issues a statement like
> SELECT * from transaction where fundID=1 ORDER BY transactionDate DESC
>
> Currently my map file looks like
> <XMLToDBMS Version="2.0" xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
>
> <Databases>
> <Database Name="Default">
> <Catalog>
> <Schema>
> <Table Name="Transaction">
> <Column Name="transactionID" DataType="INTEGER" Nullable="No"/>
> <Column Name="transactionAmount" DataType="INTEGER" Nullable="No"/>
> <Column Name="transactionDate" DataType="TIMESTAMP" Length="50"
> Nullable="No"/>
> <Column Name="transactionTypeID" DataType="INTEGER" Nullable="No"/>
> <Column Name="fundID" DataType="INTEGER" Nullable="No"/>
> <PrimaryKey KeyGenerator="Database">
> <UseColumn Name="transactionID"/>
> </PrimaryKey>
> </Table>
> </Schema>
> </Catalog>
> </Database>
> </Databases>
> <Maps>
> <ClassMap>
> <ElementType Name="Transaction"/>
> <ToClassTable Name="Transaction"/>
> <PropertyMap>
> <Attribute Name="transactionID"/>
> <ToColumn Name="transactionID"/>
> </PropertyMap>
> <PropertyMap>
> <ElementType Name="transactionAmount"/>
> <ToColumn Name="transactionAmount"/>
> </PropertyMap>
> <PropertyMap>
> <ElementType Name="transactionDate"/>
> <ToColumn Name="transactionDate"/>
> </PropertyMap>
> <PropertyMap>
> <ElementType Name="transactionTypeID"/>
> <ToColumn Name="transactionTypeID"/>
> </PropertyMap>
> <PropertyMap>
> <ElementType Name="fundID"/>
> <ToColumn Name="fundID"/>
> </PropertyMap>
> </ClassMap>
> </Maps>
> </XMLToDBMS>
>
> I will appeciate your answer
Hi,
I'm trying to use the XML-DBMS package to parse several thousand XML
files into a database. I'd like to be able to run more than one
instance of the parser at once, but I am running into problems.
I am using the Perl version of XML-DBMS (I don't know Java) and MySQL
version 5.0.26.
What is happening is that when I run more than one instance of the
parser I eventually run into duplicate key errors. Here is an
example of one of the errors:
Duplicate entry '9740' for key 1 at ./XmlRetrieve.pl line 36
If I run only one parser over the same set of files it works fine, I
only run into this when I have more than one running at a time. So
there seems to be some contention between the multiple instances.
And it doesn't fail in the same place every time. It seems to me
that it's random chance if one of the instances get its "toes stepped
on" so to speak and errors out.
Do you have any ideas? Let me know if there is any other info you
need.
Thanks,
Chris
Hello,
First, I'm sorry it took so long to reply. I had a deadline last week
that took longer than expected and another job came up unexpectedly.
I tried to reproduce your problem here and failed -- MapManager worked
fine for me. (The output map is listed below.)
I then looked at the code in XMLNameChecker to see if there were any
obvious problems. The only thing out of the ordinary with your tables is
that they both have a column named created. This causes a conflict, as
the basic algorithm in XML-DBMS is to set the element type name to the
column name. However, XML-DBMS also recognizes the potential for
conflict and will resolve it -- in your case, by prepending the table
name to created to create a unique name.
So I'm not sure where the problem lies. My guess is that the problem is
that a null String is being passed to XMLNameChecker.checkCharacters and
that it throws an exception in the first line (oldName =
name.toCharArray();). You can check this with a debugger or by adding a
simple System.out.println("got here"); statement.
What is not clear is where this null is coming from. There are two calls
to checkCharacters in the private checkName function. Again, you can
check which one is causing the problem with a debugger or println call.
Note that the second call is only executed once -- when the second
created column is encountered.
The final place to look is in MapFactory_Database.getElementTypeName.
Adding the following code before the call to
checker.checkElementTypeName will show you which table/column is causing
the error:
System.out.println("table: " + (prefixes[0] == null) ? "null"
:prefixes[0]);
System.out.println("schema: " +(prefixes[1] == null) ? "null"
:prefixes[1]);
System.out.println("catalog: " + (prefixes[2] == null) ? "null"
:prefixes[2]);
System.out.println("database: " + (prefixes[3] == null) ? "null"
:prefixes[3]);
String colname = column.getName();
System.out.println("column: " + (colname == null) ? "null" : colname);
One final note. The reason that commenting out the foreign key statement
works is that there is no key for MapManager to follow. This potentially
lends credence to the idea that the two created columns are causing a
problem, but it also suggests another possibility.
Can you check if your JDBC driver supports
DatabaseMetaData.getExportedKeys? This method is called to find the link
between your two tables by following the primary key of the
msms_pipeline_analysis table. If it isn't supported, or if support is
only partial, it's possible that a null is being introduced somewhere.
Hope this helps,
-- Ron
Generated map document
----------------------
<?xml version='1.0' encoding="Cp1252" ?>
<!DOCTYPE XMLToDBMS >
<XMLToDBMS Version="2.0" xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
<Options>
<FormatClass DefaultForTypes="BIT"
Class="org.xmlmiddleware.conversions.formatters.BooleanFormatter"/>
<SimpleDateFormat DefaultForTypes="DATE" Pattern="MMM d, yyyy"/>
<SimpleDateFormat DefaultForTypes="TIMESTAMP" Pattern="MMM d,
yyyy h:mm:ss a"/>
<SimpleDateFormat DefaultForTypes="TIME" Pattern="h:mm:ss a"/>
<DecimalFormat DefaultForTypes="BIGINT TINYINT DOUBLE REAL FLOAT
SMALLINT INTEGER DECIMAL NUMERIC" Pattern="#,##0.###"/>
<FormatClass DefaultForTypes="LONGVARCHAR VARCHAR CHAR"
Class="org.xmlmiddleware.conversions.formatters.CharFormatter"/>
<FormatClass DefaultForTypes="BINARY VARBINARY LONGVARBINARY"
Class="org.xmlmiddleware.conversions.formatters.NoFormatter"/>
</Options>
<Databases>
<Database Name="Default">
<Catalog>
<Schema>
<Table Name="msms_run_summary">
<Column Name="base_name" DataType="VARCHAR"
Length="255" Nullable="Yes"/>
<Column Name="mrs_id" DataType="INTEGER" Nullable="No"/>
<Column Name="msms_pipeline_analysis_id"
DataType="INTEGER" Nullable="Yes"/>
<Column Name="created" DataType="TIMESTAMP"
Nullable="Yes"/>
<Column Name="raw_data" DataType="VARCHAR"
Length="255" Nullable="Yes"/>
<Column Name="raw_data_type" DataType="VARCHAR"
Length="255" Nullable="Yes"/>
<ForeignKey
Name="msms_pipeline_analysismsms_run_summary">
<UseTable Name="msms_pipeline_analysis"/>
<UseUniqueKey Name="PrimaryKey"/>
<UseColumn Name="msms_pipeline_analysis_id"/>
</ForeignKey>
</Table>
<Table Name="msms_pipeline_analysis">
<Column Name="summary_xml" DataType="VARCHAR"
Length="255" Nullable="Yes"/>
<Column Name="date" DataType="VARCHAR" Length="255"
Nullable="Yes"/>
<Column Name="mpa_id" DataType="INTEGER" Nullable="No"/>
<Column Name="created" DataType="TIMESTAMP"
Nullable="Yes"/>
<PrimaryKey>
<UseColumn Name="mpa_id"/>
</PrimaryKey>
</Table>
</Schema>
</Catalog>
</Database>
</Databases>
<Maps>
<ClassMap>
<ElementType Name="msms_run_summary"/>
<ToClassTable Name="msms_run_summary"/>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="base_name"/>
<ToColumn Name="base_name"/>
</PropertyMap>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="mrs_id"/>
<ToColumn Name="mrs_id"/>
</PropertyMap>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="msms_run_summary.created"/>
<ToColumn Name="created"/>
</PropertyMap>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="raw_data_type"/>
<ToColumn Name="raw_data_type"/>
</PropertyMap>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="raw_data"/>
<ToColumn Name="raw_data"/>
</PropertyMap>
</ClassMap>
<ClassMap>
<ElementType Name="msms_pipeline_analysis"/>
<ToClassTable Name="msms_pipeline_analysis"/>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="summary_xml"/>
<ToColumn Name="summary_xml"/>
</PropertyMap>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="mpa_id"/>
<ToColumn Name="mpa_id"/>
</PropertyMap>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="date"/>
<ToColumn Name="date"/>
</PropertyMap>
<PropertyMap TokenList="No" ContainsXML="No">
<ElementType Name="created"/>
<ToColumn Name="created"/>
</PropertyMap>
<RelatedClass KeyInParentTable="Unique">
<ElementType Name="msms_run_summary"/>
<UseUniqueKey Name="PrimaryKey"/>
<UseForeignKey Name="msms_pipeline_analysismsms_run_summary"/>
</RelatedClass>
</ClassMap>
</Maps>
</XMLToDBMS>
Rob wrote:
> Hello,
>
> This problem is driving me nuts ...
> I have a database and I wish to create the appropriate map file from
> it.
>
> I run this command:
>
> java org.xmlmiddleware.xmldbms.tools.MapManager File1=parser.props
> File2=db.props Input=Database Output=Map MapFile=my.map
> RootTable=msms_pipeline_analysis FollowPrimaryKeys=Yes
>
>
> My database contains the two tables below.
>
> Now, if I comment out the FOREIGN KEY statement in the second table
> (below), I get no errors and my MapFile looks ok (it only has the
> first table in it though). If I include the foreign key as below - I
> get an error concerning XMLNameChecker. See full stack at end of this
> message.
>
> Any ideas why this might be so?
>
>
>
> =============DATABASE==============================================
>
> create table msms_pipeline_analysis(
>
> mpa_id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
> summary_xml varchar(255) not null,
> date varchar(255) not null,
> created timestamp not null default current_timestamp
>
> )engine=innodb;
>
>
>
> create table msms_run_summary(
>
> mrs_id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
> msms_pipeline_analysis_id bigint not null,
> base_name varchar(255) not null,
> raw_data_type varchar(255) not null,
> raw_data varchar(255) not null,
> created timestamp not null default current_timestamp,
>
> FOREIGN KEY (msms_pipeline_analysis_id) REFERENCES
> msms_pipeline_analysis(mpa_id)
> )engine=innodb;
>
> =====================================================================
>
>
>
> java org.xmlmiddleware.xmldbms.tools.MapManager File1=parser.props
> File2=db.props Input=Database Output=Map MapFile=my.map
> RootTable=msms_pipeline_analysis FollowPrimaryKeys=Yes
>
> java.lang.NullPointerException
> at
> org.xmlmiddleware.xmldbms.maps.factories.XMLNameChecker.checkCharacter
> s(XMLNameChecker.java:212)
> at
> org.xmlmiddleware.xmldbms.maps.factories.XMLNameChecker.checkName
> (XMLNameChecker.java:177)
> at
> org.xmlmiddleware.xmldbms.maps.factories.XMLNameChecker.checkElementTy
> peName(XMLNameChecker.java:116)
> at
> org.xmlmiddleware.xmldbms.maps.factories.MapFactory_Database.getElemen
> tTypeName(MapFactory_Database.java:1264)
> at
> org.xmlmiddleware.xmldbms.maps.factories.MapFactory_Database.linkRemot
> eTables(MapFactory_Database.java:865)
> at
> org.xmlmiddleware.xmldbms.maps.factories.MapFactory_Database.processTa
> ble(MapFactory_Database.java:714)
> at
> org.xmlmiddleware.xmldbms.maps.factories.MapFactory_Database.processRe
> moteTables(MapFactory_Database.java:913)
> at
> org.xmlmiddleware.xmldbms.maps.factories.MapFactory_Database.processTa
> ble(MapFactory_Database.java:715)
> at
> org.xmlmiddleware.xmldbms.maps.factories.MapFactory_Database.processTa
> bles(MapFactory_Database.java:567)
> at
> org.xmlmiddleware.xmldbms.maps.factories.MapFactory_Database.createMap
> (MapFactory_Database.java:417)
> at
> org.xmlmiddleware.xmldbms.tools.MapManager.createMapFromDatabase
> (MapManager.java:749)
> at org.xmlmiddleware.xmldbms.tools.MapManager.dispatch
> (MapManager.java:454)
> at org.xmlmiddleware.xmldbms.tools.MapManager.main
> (MapManager.java:348)
Hello,
1) I can't find datahandlers.MySQLHandler in the CVS tree, even as a
dead file, so I'm not sure where you got it. In any case, the one in
external is the correct one.
2) In general, it's a bad idea to use the CVS code in this project. To
quote from an earlier message [1]:
"As a general rule, I do not recommend trying to use the CVS versions of
XML-DBMS. The reason is that I use CVS as a repository for intermediate
versions of the product which, while they (supposedly) work, are not
thoroughly tested and are not guaranteed to be stable with respect to
design issues. At best you should use the CVS versions as a way to find
specific fixes to issues and then use these fixes with extreme care. Not
an ideal situation, but that's the way it goes."
I've got an even more recent version on my machine that cleans up a lot
of code and design issues. However, this has never been sent to CVS
because I ran out of time to finish it when my second child was born.
That this was almost four years ago should be an indication of the
likelihood of it ever being completed :(
The reality is that XML-DBMS is slowly being made obsolete by the XML
features in relational databases and standards-based products like
DataDirect's Connect for SQL/XML and their implementation of XQuery over
relational databases. I intend to continue supporting XML-DBMS
indefinitely, but I suppose it will go away at some point in time.
(On the good news side, XML-DBMS is still more feature rich than
offerings from most database companies, especially with respect to
inserting / updating / deleting data. When update capabilities are
finally added to SQL/XML and XQuery and these are implemented by the
major databases, that will no longer be true, but that is still several
years off.)
-- Ron
[1] http://tech.groups.yahoo.com/group/xml-dbms/message/3527
Rob wrote:
> Hi,
>
> Am confused with respect to the following:
>
> In the xmldbms cvs source there are two copies of MySQLHandler:
>
> ...datahandlers.external.MySQLHandler.java
> ...datahandlers.MySQLHandler
>
> (In addition to the one in datahandlers.MySQLHandler - states that its
> in package ...datahandlers.external)
>
> When I compile these and attempt to use - I am getting errors (see below).
>
> Can anyone provide more explicit instructions about how to compile
> this code (and where it should be etc)
>
> thanks
>
>
> ==================================================================
> Exception in thread "main" java.lang.Error: Unresolved compilation
> problem:
>
> The declared package "org.xmlmiddleware.xmldbms.datahandlers.external"
> does not match the expected package
> "org.xmlmiddleware.xmldbms.datahandlers"
> at
>
org.xmlmiddleware.xmldbms.datahandlers.MySQLHandler.<init>(MySQLHandler.java:20)
> ====================================================================
>
>
>
>
> To post a message, send it to: xml-dbms@yahoogroups.com
> To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>