Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

xml-dbms

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 792
  • Category: XML
  • Founded: Mar 5, 2000
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 3205 - 3236 of 3869   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#3205 From: rajadayalan <rajadhayalan@...>
Date: Mon Nov 3, 2003 8:39 am
Subject: comma gets appended while retrieving numeric data from dbms
rajadhayalan@...
Send Email Send Email
 
Hi,

I'm new to xmldbms. When i retrieve numeric data from sql server using
xmldbms2.0 , gets appended to the data. For eg an id 1065697033878 gets
retreived as 1,065,697,033,878. How do i remove these commas. Is there any step
i should do to strip these commas.

Any help is appreciated. Thanks in advance.

Note:- Yahoo groups is banned in India. I can send/receive mails from yahoo
groups. I'll not be able to browse the archives. So when u reply for this mail
please send a copy of it to me.

regards
dayalan



---------------------------------
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears

[Non-text portions of this message have been removed]

#3206 From: Adam Flinton <adam@...>
Date: Thu Nov 6, 2003 6:00 pm
Subject: Problems with the source.
adam@...
Send Email Send Email
 
Just done a cvs download from sourceforge.

Some problems:

org.xmlmiddleware.db:

CPConnection implements Connection :

Doesn't implement Connection fully. There are a whole load of abstract
methods left out.

SPPreparedStatement implements PreparedStatement, Statement:

Doesn't implement all of  PreparedStatement, Statement.


org.xmlmiddleware.db.jdbc

MSAccessConnection implements Connection :

Doesn't implement all the abstract Connection methods.

MSAccessDBMetaData implements DatabaseMetaData :

Doesn't implement all the abstract DatabaseMetaData methods.


org.xmlmiddleware.xmldbms.datahandlers.external

MySQLHandler:

I have the newer jar for MySQl & it doesn't seem to have:

org.gjt.mm.mysql.Statement

Best to use an old jar or does this class need updating (or even a near
copy called "New_MySQL" ?

PostgresHandler

I have all the PostGreSQL Driver but in them there is no:

  org.postgresql.Statement



Any ideas? Should I redo some of it of are there other answers?

Adam

#3207 From: "e9725082" <gerald_leder@...>
Date: Thu Nov 6, 2003 6:25 pm
Subject: Re: Problems with the source.
e9725082
Send Email Send Email
 
--- In xml-dbms@yahoogroups.com, Adam Flinton <adam@s...> wrote:
> Just done a cvs download from sourceforge.
>
> Some problems:
>
> org.xmlmiddleware.db:
>
> CPConnection implements Connection :
>
> Doesn't implement Connection fully. There are a whole load of
abstract
> methods left out.
>
> SPPreparedStatement implements PreparedStatement, Statement:
>
> Doesn't implement all of  PreparedStatement, Statement.
The methods are commented out to compile it with jdk 1.2. For jdk 1.3
and 1.4 you will have to uncomment the methods (see in the classes)
in SPPreparedStatement the comment start at line 435 and for
CPConnection at line 373
see the line were it is written "// Comment these methods to compile
with JDBC 2.0"

> MySQLHandler:
> I have the newer jar for MySQl & it doesn't seem to have:
> org.gjt.mm.mysql.Statement
> Best to use an old jar or does this class need updating (or even a
near copy called "New_MySQL" ?

The MySQL driver (since version 3.0) has changed its package name!
(also its license its now GPL).
The new package name is com.mysql.jdbc - all classes expect the
org.gjt.mm.mysql.Driver class have been moved to the new package.

#3208 From: "openjo2000" <openjo2000@...>
Date: Thu Nov 6, 2003 8:52 pm
Subject: SQL Server Forum
openjo2000
Send Email Send Email
 
Managing Microsoft SQL Server for Scalability and High
Availability

is presented in Houston and can register for it @

http://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-
US&EventID=1032237057

#3209 From: Adam Flinton <adam@...>
Date: Fri Nov 7, 2003 10:29 am
Subject: Re: Re: Problems with the source.
adam@...
Send Email Send Email
 
e9725082 wrote:

>--- In xml-dbms@yahoogroups.com, Adam Flinton <adam@s...> wrote:
>
>
>>Just done a cvs download from sourceforge.
>>
>>Some problems:
>>
>>org.xmlmiddleware.db:
>>
>>CPConnection implements Connection :
>>
>>Doesn't implement Connection fully. There are a whole load of
>>
>>
>abstract
>
>
>>methods left out.
>>
>>SPPreparedStatement implements PreparedStatement, Statement:
>>
>>Doesn't implement all of  PreparedStatement, Statement.
>>
>>
>The methods are commented out to compile it with jdk 1.2. For jdk 1.3
>and 1.4 you will have to uncomment the methods (see in the classes)
>in SPPreparedStatement the comment start at line 435 and for
>CPConnection at line 373
>see the line were it is written "// Comment these methods to compile
>with JDBC 2.0"
>
>
>

Thanks. Done

>>MySQLHandler:
>>I have the newer jar for MySQl & it doesn't seem to have:
>>org.gjt.mm.mysql.Statement
>>Best to use an old jar or does this class need updating (or even a
>>
>>
>near copy called "New_MySQL" ?
>
>The MySQL driver (since version 3.0) has changed its package name!
>(also its license its now GPL).
>The new package name is com.mysql.jdbc - all classes expect the
>org.gjt.mm.mysql.Driver class have been moved to the new package.
>
>
>
>
OK. Should this be changed in the version in CVS?

Also despite having all the PGSQL jars I can find in my classpath I
still get: "org.postgresql.Statement cannot be resolved or is not a
type" in the PostgresHandler


Any ideas wrt:

MSAccessDBMetaData not implementing all of  DatabaseMetaData &
MSAccessConnection not implementing all of Connection? Is this another
JDBC 2 thing much like CPConnection etc?

If so is anyone planning on doing a similar thing (i.e. commented out
methods)?


Adam

#3210 From: Adam Flinton <adam@...>
Date: Fri Nov 7, 2003 10:36 am
Subject: Re: Re: Problems with the source.
adam@...
Send Email Send Email
 
Re the PGSQL problem, has the class in the driver jars been changed from
org.postgresql.Statement to org.postgresql.PGStatement?

Adam

#3211 From: "lehmjas999" <lehmjas999@...>
Date: Fri Nov 7, 2003 4:12 pm
Subject: Repeating Rows
lehmjas999
Send Email Send Email
 
Sorry if this has been asked before but I am trying to knock out a
project and have just come across this tool and I am new to XML.
How would you handle the table below with a map.  I have an example
with using a database but I haven't found one like this.  Thanks for
any help.

Table Name: Letters

Col1  Col2
A     A
A     B
A     C

So that you would get
<Letters>
   <Col1>A</Col1>
   <Col2>A</Col2>
   <Col2>B</Col2>
   <Col2>C</Col2>
</Letters>

#3212 From: rpbourret@...
Date: Fri Nov 7, 2003 4:47 pm
Subject: Re: Re: Problems with the source.
xmldbms
Send Email Send Email
 
First, to all those with unanswered questions, I'll try to get to you next
week. I was out of town all last week and have been gone most of this week.

See answers below.

> e9725082 wrote:
> >>MySQLHandler:
> >>I have the newer jar for MySQl & it doesn't seem to have:
> >>org.gjt.mm.mysql.Statement
> >>Best to use an old jar or does this class need updating (or even a
> >near copy called "New_MySQL" ?
> >
> >The MySQL driver (since version 3.0) has changed its package name!
> >(also its license its now GPL).
> >The new package name is com.mysql.jdbc - all classes expect the
> >org.gjt.mm.mysql.Driver class have been moved to the new package.
> >
> OK. Should this be changed in the version in CVS?

Probably. I'll look into this a bit later.

> Also despite having all the PGSQL jars I can find in my classpath I
> still get: "org.postgresql.Statement cannot be resolved or is not a
> type" in the PostgresHandler

I don't have PostgreSQL or PostgreSQL drivers on my machine, so I'll have to do
some poking around to find the problem. (Anybody

> Any ideas wrt:
>
> MSAccessDBMetaData not implementing all of  DatabaseMetaData &
> MSAccessConnection not implementing all of Connection? Is this another
> JDBC 2 thing much like CPConnection etc?
>
> If so is anyone planning on doing a similar thing (i.e. commented out
> methods)?

It is a similar thing. I don't have the code in front of me right now, so I
can't remember if the methods are present and commented out or need to be
added. If they need to be added, that's a simple enough thing to do -- just add
the necessary methods and have them call the corresponding methods in the
underlying driver. (If the underlying driver doesn't support these methods,
then just do nothing / return null / etc., as the methods are never called.)

Note also that you need the Access driver only if (1) you are using MS Access
and (2) you are generating a map / DTD from a database schema. For this reason,
it should be compiled into a separate .jar.

Also, as I've said before, you should be careful if you are using the CVS
version of the code. It is only lightly tested and will have some significant
changes before the next release.

--
Ron

#3213 From: rpbourret@...
Date: Fri Nov 7, 2003 4:55 pm
Subject: Re: Repeating Rows
xmldbms
Send Email Send Email
 
XML-DBMS does not directly support this. With XML-DBMS you can create the
following document (or something similar):

    <Lots_of_letters>
       <Letters>
          <Col1>A</Col1>
          <Col2>A</Col2>
       </Letters>
       <Letters>
          <Col1>A</Col1>
          <Col2>B</Col2>
       </Letters>
       <Letters>
          <Col1>A</Col1>
          <Col2>C</Col2>
       </Letters>
    </Lots_of_letters>

You would then need to use XSLT to transform this to the document you want.

-- Ron

> Sorry if this has been asked before but I am trying to knock out a
> project and have just come across this tool and I am new to XML.
> How would you handle the table below with a map.  I have an example
> with using a database but I haven't found one like this.  Thanks for
> any help.
>
> Table Name: Letters
>
> Col1  Col2
> A     A
> A     B
> A     C
>
> So that you would get
> <Letters>
>   <Col1>A</Col1>
>   <Col2>A</Col2>
>   <Col2>B</Col2>
>   <Col2>C</Col2>
> </Letters>

#3214 From: "xmldbms" <rpbourret@...>
Date: Fri Nov 7, 2003 5:10 pm
Subject: Re: Transfer ClassCastException
xmldbms
Send Email Send Email
 
That is correct. I don't have the code in front of me, but the order
column cannot be character, date, etc. If I remember correctly, any
type of numeric column (integer, float, decimal, etc.) can be used.

The map compiler should probably check for this.

-- Ron

--- In xml-dbms@yahoogroups.com, "cafulnecky" <cafulnecky@y...> wrote:
> The problem was in the OrderColumn element, apparently does not
like
> the datatype?
>
>       <ClassMap>
>          <ElementType Name="MiningSession"/>
>          <ToClassTable Name="MININGSESSIONS"/>
>              .
>              .
>              .
>          <RelatedClass KeyInParentTable="Unique">
>             <ElementType Name="Equipment"/>
>             <UseUniqueKey Name="MININGSESSION_PK"/>
>             <UseForeignKey Name="MININGSESSION_FK"/>
>             <!-- DataType is VARCHAR causing an error -->
>             <OrderColumn Name="MININGSESSION"
Direction="Ascending" />
>          </RelatedClass>
>       </ClassMap>
>
> --- In xml-dbms@yahoogroups.com, "cafulnecky" <cafulnecky@y...>
wrote:
> > I am getting the following exception when trying to retrieve from
a
> > database, the error only occurs when I set the MININGSESSIONS
table
> > as the root.  All other tables return expected data when used in

#3215 From: "xmldbms" <rpbourret@...>
Date: Fri Nov 7, 2003 5:18 pm
Subject: Re: How to generate primary keys of related table (new to XMLToDBMS)
xmldbms
Send Email Send Email
 
XML-DBMS version 1.x does not generate primary keys in leaf tables
such as UNIT. This is a design bug and has been fixed in version 2.0.

The workarounds for this in 1.x are:

a) Set the data type of the primary key column in the leaf table so
that the database generates the key. For example, use an auto-
increment data type or a generated data type such as ROWID in Oracle.

b) Set a trigger on the primary key column in the leaf table so that
it generates a key.

-- Ron

--- In xml-dbms@yahoogroups.com, "jmurtonen" <jmurtonen@h...> wrote:
> Hi,
>
> sorry about the formatting of the output (DB content) in my last
> message. My DB has the following data after Transfer sample:
>
> SUPPLY (id, year, number):
> 60, 2003, 800800
>
> UNIT (id, print_id, date, supply_id):
> NULL, 333444, '2002-10-19 08:08:08.000', 60
> NULL, 111222, '2002-10-18 10:10:10.000', 60
>
> Thank you for any help,
>
> Mr Janne Murtonen, Finland
> --- In xml-dbms@yahoogroups.com, "jmurtonen" <jmurtonen@h...> wrote:
> > Hi,
> >
> > I'm new to XMLToDBMS and I have a problem with generating keys. I
> > have two tables related to each other. How can I
> > - generate primary keys to both tables AND
> > - set table's foreign key (which is other table's generated
primary
> > key)
> >
> > I use XMLToDBMS v1.0 and sample Transfer. I can get all the other
> > information to DB, but UNIT table's id is not set. Here's what I
> have
> > done:

#3216 From: "xmldbms" <rpbourret@...>
Date: Fri Nov 7, 2003 5:44 pm
Subject: Re: comma gets appended while retrieving numeric data from dbms
xmldbms
Send Email Send Email
 
By default, XML-DBMS formats numbers and dates according to the
current locale. You can override this with the formatting elements --
DecimalFormat, NumberFormat, DateFormat, TimeFormat, DateTimeFormat,
and SimpleDateFormat. You will use the DecimalFormat element.

If you want to specify a single format for all columns of a
particular type, then you can use the DefaultForTypes attribute of
the DecimalFormat element. For example:

    <Options>
       <!-- I think this pattern will work. See the JavaDocs
            for the java.text.DecimalFormat class if it doesn't. -->
       <DecimalFormat Pattern="#" DefaultForTypes="INTEGER" />
    </Options>

You can also specify a format for a particular column by naming the
format and using that name in the Format attribute of the Column
element. For example:

    <Options>
       <!-- Define and name a format here. -->
       <DecimalFormat Pattern="#" Name="IDFormat" />
    </Options>
    <Databases>
       <Database>
          <Catalog>
             <Schema>
                <Table Name="MyTable">
                   ...
                   <!-- Reference the format here -->
                   <Column Name="ID" DataType="INTEGER"
Format="IDFormat" />
                   ...
                </Table>
             </Schema>
          </Catalog>
       </Database>
    </Databases>

-- Ron

--- In xml-dbms@yahoogroups.com, rajadayalan <rajadhayalan@y...>
wrote:
> Hi,
>
> I'm new to xmldbms. When i retrieve numeric data from sql server
using
xmldbms2.0 , gets appended to the data. For eg an id 1065697033878
gets
retreived as 1,065,697,033,878. How do i remove these commas. Is
there any step
i should do to strip these commas.
>
> Any help is appreciated. Thanks in advance.
>
> Note:- Yahoo groups is banned in India. I can send/receive mails
from yahoo
groups. I'll not be able to browse the archives. So when u reply for
this mail
please send a copy of it to
me.

#3217 From: "xmldbms" <rpbourret@...>
Date: Fri Nov 7, 2003 6:14 pm
Subject: Re: Newbie: some questions
xmldbms
Send Email Send Email
 
See below...

--- In xml-dbms@yahoogroups.com, "e9725082" <gerald_leder@g...> wrote:
> Hi!
>
> I'm a newbie and I have some questions.
> I want to integrate the xmldbmiddleware in an existing framework,
but
> I have a few question to the current implementation (v2.0 cvs):
>
> 1. I get a connection object from the framework, but I don't
want/can
> not use the JDBC(1/2)DataSource, because here a new connection is
> created. I saw in the cvs that there is a class ArrayDataSource
where
> can I give a connection in the constructor. I think its the same as
> JDBCxDataSource or?

It is not the same. JDBCxDataSource encapsulates an existing
DataSource object. ArrayDataSource does what you think -- it gives
you the ability to create a DataSource from a set of existing
Connection objects.

> My main question is
> .) if I can use ArrayDataSource instead of JDBCxDataSource and

Yes. The only restriction is that you can't use the Transfer tool --
you need to use DOMToDBMS, DBMSToDOM, and DBMSDelete directly. I
might fix this in the next release.

> .) if the connection is EVER closed when I use the ArrayDataSource
> object or not. Thats for me important because the connection object
> should be in the control of the framework and should not be closed
> (the connection is used not only by the xmlmiddleware tool).

It is not closed in alpha 3 or the current CVS version. I need to
check that I have not just broken this in the version on my machine :(

> 2. My second use case is that I get from a stored procedure a
> resultset back and I have to convert it into DOM. I have seen that
> there is a method DBMSToDOM.retrieveDocument(DBEnabledMap dbMap,
> ResultSet rs, FilterSet filterSet, Hashtable params, Node
rootNode).
> I think this is the right method for me but I'm not sure what I
have
> to set for the filterset, because I have already the finished
> resultset from the procedure. What should I pass here for this
> parameter??

This is the correct method. For a complete description of what you
need to do, see:

    http://groups.yahoo.com/group/xml-dbms/message/3140

> 3. In the readme of the version of 1.0 I read under point "7.2
> TransferResultSet (Advanced)" that I can specify any query string.
As
> I know its included in the Transfer object now since version 2.0
> (http://groups.yahoo.com/group/xml-dbms/message/3106).
> I exactly need the possibility that a user can specify a query in
an
> textarea and specify also a mapping file. So far I don't know if I
> have to use the transfer class for this or should I use the
DBMStoDOM
> class (but which method??). Or in which class is this now possible
> now in version 2.0. Or do you have a better way?

You can use either Transfer or DBMSToDOm. Again, see the message
above.

> 4. For another use case I have to insert an XML document via a
stored
> procedure to a DB. What I know so far this is not covered by this
> package now, or??
> My question would be how I can do it with this package. Are there
any
> objects which a can reuse (any low level objects than DOMToDBMS)??
> because I still want to keep the mapping alg. of your package. Do
you
> have any suggestion for this problem??

Do you mean that the stored procedure will accept an XML document and
needs to transfer the data in this document to tables in the
database? If so, this is possible only if you can call XML-DBMS from
your stored procedure. I have no idea if this is possible -- it
probably depends on the database you are using.

As to low-level objects you can reuse, the main low-level objects are
DOMToDBMS, DBMSToDOM, DBMSDelete, XMLDBMSMap, and TransferInfo.
Reusing XMLDBMSMap/TransferInfo is particularly important, as
compiling map documents is an expensive operation.

> 5. I read in the 2.0 specification that there is a bug with the SQL
> Server ("can't retrieve documents nested more than one table
deep").
> Is this bug fixed or can you tell me at least the status of it.

This bug is finally fixed, but I haven't released it yet because I
haven't finished all of the surrounding changes. (I also need to
check that I didn't close connections and introduce a bug...)

And in anticipation of your next question, I refuse to say when I
will release the fix -- my schedule is just to hectic to make those
sorts of predictions :)

-- Ron

#3218 From: "xmldbms" <rpbourret@...>
Date: Fri Nov 7, 2003 6:30 pm
Subject: Re: Maximum Cursors Exceeded error in Oracle
xmldbms
Send Email Send Email
 
I have no idea what is happening, but I have a bad feeling that the
problem is in the DataSource/Connection/Statement pooling code. My
guess is that this is not closing things correctly, as I have seen
similar problems before. (Once I finish the latest set of changes,
the next area I plan to look at is the pooling code.)

Any additional information you can provide will probably help.

-- Ron

--- In xml-dbms@yahoogroups.com, "cafulnecky" <cafulnecky@y...> wrote:
> I am noticing some strange behavior when inserting a dataset
similar
> to the Orders example containing 123 items.  In MSAccess it moves
> along quickly until the 76th item from there I can refresh the
table
> inside access and see new rows been added one at a time at a rate
of
> 1 every few seconds (on a P4 2.4ghz box) cpu is at 0% utilization
for
> the several minutes it takes to complete the operation.  If the
> records already exist (repeat the insert operation) the operation
> takes ~1-2 seconds.
>
> Repeating the process in Oracle produces a Maximum Cursors Exceeded
> error.  The first time I try it I get 76 records in two tables
> roughly corresponding to the parts and items tables and 1 record
each
> in the two tables that correspond to the Customers and Orders
> tables.  The next time I get the next 38 records to persist.  The
3rd
> time the rest of the records persist and all 123 expected records
are
> in the oracle database.
>
> The pattern is I can insert 76 + 76 +1 +1 records into 4 different
> tables the  first time.
>
> 38 + 38 the second time.
>
> The rest the third time for a total of 123 + 123 + 1 + 1.
>
> Has anyone else run across this behavior?

#3219 From: "xmldbms" <rpbourret@...>
Date: Fri Nov 7, 2003 6:33 pm
Subject: Re: Maximum Cursors Exceeded error in Oracle
xmldbms
Send Email Send Email
 
The code looks correct.

As to the Transfer behavior, my only guess is that, if you call
Transfer multiple times from a program, many things (including
Connections, Statements, etc.) are left open for reasons of
efficiency / reuse. Obviously, this won't work if too many things are
left open.

When you call Transfer from the command line, it opens a connection
to a database, processes the document, and closes the connection.
There is therefore less opportunity to run out of resources, although
this may depend on the size of the document.

-- Ron

--- In xml-dbms@yahoogroups.com, "cafulnecky" <cafulnecky@y...> wrote:
> I'm beginning to suspect the JDBC Driver (+ eclipse?), since DBEdit
> plugin exhibits similar behavior, curiously enough command line
> version of transfer does not exhibit the same behavior ... is there
> something wrong with the following? -------
>
>  private void processXMLDBMSPersistence(Properties
> configProps,boolean store)
> 				 throws
> XMLMiddlewareException, SQLException, ClassNotFoundException
>  {
>
> 	 try {
> 	 Transfer xfer = new Transfer(configProps);
> 	 String map = configProps.getProperty
> ("MapLocation");       //"samples/orders.map";
> 	 String action = configProps.getProperty
> ("ActionLocation"); //"samples/orders1.act";
> 	 String xml = configProps.getProperty
> ("XMLLocation");       //"samples/orders.xml";
> 	 xfer.setDatabaseProperties(configProps);
>         if (store) {
> 		 xfer.storeXMLDocument(configProps, map,
> action, xml);
>         }
>         else {
>
> 		 String     filterLocation;
> 		 Hashtable  params      = configProps;
>
> 		 // Get the names of filter
> 		 filterLocation = configProps.getProperty
> ("FilterLocation");
> 		 // Process parameters used in IN clauses in
> filters, if any.
> 		 //processINParameters(params);
> 		 // Retrieve the document.
> 		 xfer.retrieveXMLDocument(configProps, map,
> filterLocation, params, xml);
> 	 }
> 	 System.out.println("Database populated ");
> 	 }
> 	 catch (Exception e) {
> 		 throw new XMLMiddlewareException (e.getMessage
> ());
> 	 }
>
>
>  }
>
> --- In xml-dbms@yahoogroups.com, "cafulnecky" <cafulnecky@y...>
wrote:
> > I am noticing some strange behavior when inserting a dataset
> similar
> > to the Orders example containing 123 items.  In MSAccess it moves
> > along quickly until the 76th item from there I can refresh the

#3220 From: "lehmjas999" <lehmjas999@...>
Date: Fri Nov 7, 2003 6:55 pm
Subject: Re: Repeating Rows
lehmjas999
Send Email Send Email
 
Thank you very much for the help.

--- In xml-dbms@yahoogroups.com, rpbourret@r... wrote:
> XML-DBMS does not directly support this. With XML-DBMS you can
create the
> following document (or something similar):
>
>    <Lots_of_letters>
>       <Letters>
>          <Col1>A</Col1>
>          <Col2>A</Col2>
>       </Letters>
>       <Letters>
>          <Col1>A</Col1>
>          <Col2>B</Col2>
>       </Letters>
>       <Letters>
>          <Col1>A</Col1>
>          <Col2>C</Col2>
>       </Letters>
>    </Lots_of_letters>
>
> You would then need to use XSLT to transform this to the document
you want.
>
> -- Ron
>
> > Sorry if this has been asked before but I am trying to knock out
a
> > project and have just come across this tool and I am new to
XML.
> > How would you handle the table below with a map.  I have an
example
> > with using a database but I haven't found one like this.  Thanks
for
> > any help.
> >
> > Table Name: Letters
> >
> > Col1  Col2
> > A     A
> > A     B
> > A     C
> >
> > So that you would get
> > <Letters>
> >   <Col1>A</Col1>
> >   <Col2>A</Col2>
> >   <Col2>B</Col2>
> >   <Col2>C</Col2>
> > </Letters>

#3221 From: Charles Fulnecky <cafulnecky@...>
Date: Fri Nov 7, 2003 10:06 pm
Subject: Re: Re: Maximum Cursors Exceeded error in Oracle
cafulnecky
Send Email Send Email
 
Ron,

I only call transfer once, and I'm using the same document, both from the
command line and with the plugin.  I would expect both would fail but for some
reason transfercmdline succeeds, wierd.  I do know that I took a few shortcuts
in the plugin compared with the path the cmdline transfer takes through the code
.... just to add more confusion ... the plugin transfer works great with mysql
... go figure.

So to summarize -
    sun.jdbc.odbc.JdbcOdbcDriver .....  Slooooow
    oracle.jdbc.driver.OracleDriver ......  Fast but Max Cursors Exceeded error
    org.gjt.mm.mysql.Driver ............... Fast and Works Flawlessly

Thanks,

Charlie
xmldbms <rpbourret@...> wrote:
The code looks correct.

As to the Transfer behavior, my only guess is that, if you call
Transfer multiple times from a program, many things (including
Connections, Statements, etc.) are left open for reasons of
efficiency / reuse. Obviously, this won't work if too many things are
left open.

When you call Transfer from the command line, it opens a connection
to a database, processes the document, and closes the connection.
There is therefore less opportunity to run out of resources, although
this may depend on the size of the document.

-- Ron




---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

[Non-text portions of this message have been removed]

#3222 From: "e9725082" <gerald_leder@...>
Date: Sat Nov 8, 2003 7:30 am
Subject: Re: Newbie: some questions
e9725082
Send Email Send Email
 
First of all thanx for your answer!
See below!

--- In xml-dbms@yahoogroups.com, "xmldbms" <rpbourret@h...> wrote:
> See below...

> > 4. For another use case I have to insert an XML document via a
> stored
> > procedure to a DB. What I know so far this is not covered by this
> > package now, or??
> > My question would be how I can do it with this package. Are there
> any
> > objects which a can reuse (any low level objects than
DOMToDBMS)??
> > because I still want to keep the mapping alg. of your package. Do
> you
> > have any suggestion for this problem??
>
> Do you mean that the stored procedure will accept an XML document
and
> needs to transfer the data in this document to tables in the
> database? If so, this is possible only if you can call XML-DBMS
from
> your stored procedure. I have no idea if this is possible -- it
> probably depends on the database you are using.
>
> As to low-level objects you can reuse, the main low-level objects
are
> DOMToDBMS, DBMSToDOM, DBMSDelete, XMLDBMSMap, and TransferInfo.
> Reusing XMLDBMSMap/TransferInfo is particularly important, as
> compiling map documents is an expensive operation.

I want to transfer an XML document to the follwing structure
"{ call procname( ?, ? )}".
Its the same as for a PreparedStatement, I just use the
CallableStatement object - everything is (almost) the same.
I have a kind of "hack" for this problem. I "just" had to implement
my own datahandler - and it works. In the implementation I just
implemented the insert and selection part of the interface (delete
makes in this context no sense). I could here reuse a lot of the
existing code (some are just copy paste of the your original
implementation).
The only problem what I face now is that the order of the parameters.
For the selection part there should be a solution because I have the
fixed order. I have not tried it yet but I hope I can do it.
The bigger problem what I have is the insert because here I don't
have the orderinfo object - The columns come from a hashtable - which
means
Hashtable.elements -> therefore they are ordered after the java
hashtable alg. which can be very tricky when you have to call a
stored procedure with 20 parameters.
Here I have only 2 possibilties - either I change the order of the
parameters of the stored procedure (which is mostly not possible) or
I change the names of the XML document so that the order is correct
(not really easy).
I can just suggest that the interface of the datahandler for
insert/update can be so extended that there is also the orderinfo
object avaiable - would be nice:)).

The advantage of this approach is that the dtd havenot to be changed.
The procedure name is the tablename.

As far as i understand the framework (I'm just guessing now) it would
not be possible to call stored functions, e.g.
{?= call proc(?,?,?)}
because for generating the result document you need a result set with
columnname(s) - the names are necessary to generate the XML document.
I haven't tried it now and I know too few about stored functions to
say know if I'm right or wrong with my assumption that it will not
work with the current XML-DMBS implementation. But thats just
theorectical for me now. Maybe you have here more experience.

>
> > 5. I read in the 2.0 specification that there is a bug with the
SQL
> > Server ("can't retrieve documents nested more than one table
> deep").
> > Is this bug fixed or can you tell me at least the status of it.
>
> This bug is finally fixed, but I haven't released it yet because I
> haven't finished all of the surrounding changes. (I also need to
> check that I didn't close connections and introduce a bug...)
>
I have tried it with the alpha 3 version (but its a sql server 2000 -
jdbc sp1 driver ) and everything work. The error description was
sofar as i remeber for sql server 7.0.  I also tested my connection
with
http://groups.yahoo.com/group/xml-dbms/message/1242
          DatabaseMetaData dbm = con.getMetaData();
          return dbm.getMaxStatements();
and it returned my 0 - javadoc: "a result of zero means that there is
no limit or the limit is not known" - so this didnot tell my
anything. But I tried it to repeat the error description in the
messages above and it seems that it works (at least what i have
tested).


> And in anticipation of your next question, I refuse to say when I
> will release the fix -- my schedule is just to hectic to make those
> sorts of predictions :)
I know that you are a very busy man and I also want to thank you for
your great project - you saved my a lot of time. My only concern
is/was that as long it is in the alpha state that changes in the DTD
can be made which are not backward compatible. It would be just hard
to explain user how to change their dtds (how,why,...).

>
> -- Ron

Gerald

#3223 From: "e9725082" <gerald_leder@...>
Date: Sat Nov 8, 2003 8:12 am
Subject: ParserUtilsXerces
e9725082
Send Email Send Email
 
hi!

Can someone explain me when I create the Document from the normal
xerces parser that i always get
java.lang.IllegalArgumentException: Local name cannot be null.
  at org.xmlmiddleware.xmlutils.XMLName.checkLocalName
(XMLName.java:618)
  at org.xmlmiddleware.xmlutils.XMLName.getUniversalName
(XMLName.java:341)

(Its already mentioned in http://groups.yahoo.com/group/xml-
dbms/message/2499)
but when i use the ParserUtilsXerces class to create the document
(the same document) it works?
With this code it works
ParserUtilsXerces pars = new ParserUtilsXerces();
Document doc =  pars.openDocument(new InputSource(new FileReader
("orders.xml")), false );
but not with a normal xerces parser not?!?

Have anyone an idea?

gerald

#3224 From: "abdelhachim" <abdelhachim@...>
Date: Mon Nov 10, 2003 1:19 pm
Subject: Re: Maximum Cursors Exceeded error in Oracle
abdelhachim
Send Email Send Email
 
--- In xml-dbms@yahoogroups.com, "xmldbms" <rpbourret@h...> wrote:
> I have no idea what is happening, but I have a bad feeling that
the
> problem is in the DataSource/Connection/Statement pooling code. My
> guess is that this is not closing things correctly, as I have seen
> similar problems before. (Once I finish the latest set of changes,
> the next area I plan to look at is the pooling code.)
>


I don't know if it is exacltly the same issue but here is what I
found and how I resolve it :

SYMPTOMS:
=========

I use XML-DBMS 2.0 alpha 3 in RETRIEVE mode only...

I had no problem with a simple Map but when the Map became quite
complex I got a Message saying that the max number of prepared
Statements had been exceeded (256 in The IBM JDBC Driver to BD2
AS/400)...


First DIAGNOSTIC :
==================

I Opened The DB2 server Job (process) initialized for the XML-DBMS
connection on the AS400 and found that there was too many tables
(files) opened...
It Seems that DB2 open, for each prepared statement, all necessary
tables and views...
Tables that were mapped deeply in the MAP file (related class to a
related class to..) were opened too many times.


DEEP DIAGNOSTIC :
=================

I decided to examine XML-DBMS source :

* SELECT Statements are prepared in : DataHandlerBase.makeSelect
(This use a pool of prepared statement, a new prepared statement is
created only if there is no one available on the pool).

I had to trace where Result Sets (Cursors) are Opened and Closed and
where statements are prepared and closed or checked-in (released
back to the pool).


* Caller Hierarchy of DataHandlerBase.makeSelect is as Follow :
-> DataHandlerBase.makeSelect
      !
      +----- DataHandlerBase.select (Wich actually executes the
               !           statement and returns a ResultSet)
               !
               +----DBMSToDOM.processPropertyTable (Process The
               !           ResultSet and close it immediately)
               !
               +----DBMSToDOM.processRelatedClassTable (Process The
               !           ResultSet and close it immediately)
               !
               +----DBMSToDOM.retrieveRootTableData (Process The
               !           ResultSet and close it immediately)
               !
               +----DBMSDelete.getResultSet
                     !
                     +---DBMSDelete.processRelatedClassTable (Process
                     !       the ResultSet and close it immediately)
                     !
                     +---DBMSDelete.processRootTable (Process
                             the ResultSet and close it immediately)


RESULT SETS:
------------

In all cases, Result Sets are closed as soon as all rows are
processed, but this also means that Result Sets will stay opened
until all children are processed ===> There may be too many Result
Sets (Cursors) opened only if the MAP is too "deep"...


PREPARED STATEMENTS :
---------------------

I didn't found any explicit close (or Check-in) of prepared
statements... They are checked-in only when their wrappers
(SPPreparedStatement) are garbage-collected (close() is issued from
the finalize methode)...
Since Garbage-Collecting is not a continuous process and is
depending on the JVM implementation, statements may be prepared (new
prepared statements added to the pool) more quickly than they are
checked-in ====> Max resources allowed by DB server may be reached.


SOLUTION :
==========

we have to close Statements each time we close ResultSets, but at
the time we close the ResultSet, related Statement is not available
in the code (Note that we have to close the wrapper
SPPreparedStatement which actually release-back the statement to the
pool, so we can't use ResultSet.getStatement().close())

The solution I adopted is "dirty" but has the less impact on the
code...

===> A New Class StmtResultSet

      public class StmtResultSet {
	 public ResultSet rs;
	 public PreparedStatement stmt;
	 public StmtResultSet(ResultSet rs, PreparedStatement stmt) {
		 this.rs = rs;
		 this.stmt = stmt;
	 }
      }


===> DataHandlerBase.select Return StmtResultSet instead of ResultSet

     public StmtResultSet select(Table table, Key key,
                                 Object[] keyValue, String where,
                                 Column[] paramColumns,
                                 Object[] paramValues,
                                 OrderInfo orderInfo)
                                 throws SQLException
     {
         checkState();
         PreparedStatement stmt = makeSelect(table, key, keyValue,
                       where, paramColumns, paramValues, orderInfo);
	 return new StmtResultSet(stmt.executeQuery(), stmt);
     }

===> in DBMSToDOM.processPropertyTable ,
         DBMSToDOM.processRelatedClassTable ,
         DBMSToDOM.retrieveRootTableData ,
         DBMSDelete.processRelatedClassTable ,
         DBMSDelete.processRootTable

      Replace rs.close() by something like
            stmtrs.rs.close();
            stmtrs.stmt.close();




Abdel

#3225 From: "abdelhachim" <abdelhachim@...>
Date: Mon Nov 10, 2003 1:25 pm
Subject: Re: Maximum Cursors Exceeded error in Oracle
abdelhachim
Send Email Send Email
 
Sorry, my post lost the indentation... I hope it will be fixed this
time



--- In xml-dbms@yahoogroups.com, "xmldbms" <rpbourret@h...> wrote:
> I have no idea what is happening, but I have a bad feeling that
the
> problem is in the DataSource/Connection/Statement pooling code. My
> guess is that this is not closing things correctly, as I have seen
> similar problems before. (Once I finish the latest set of changes,
> the next area I plan to look at is the pooling code.)
>


I don't know if it is exacltly the same issue but here is what I
found and how I resolve it :

SYMPTOMS:
=========

I use XML-DBMS 2.0 alpha 3 in RETRIEVE mode only...

I had no problem with a simple Map but when the Map became quite
complex I got a Message saying that the max number of prepared
Statements had been exceeded (256 in The IBM JDBC Driver to BD2
AS/400)...


First DIAGNOSTIC :
==================

I Opened The DB2 server Job (process) initialized for the XML-DBMS
connection on the AS400 and found that there was too many tables
(files) opened...
It Seems that DB2 open, for each prepared statement, all necessary
tables and views...
Tables that were mapped deeply in the MAP file (related class to a
related class to..) were opened too many times.


DEEP DIAGNOSTIC :
=================

I decided to examine XML-DBMS source :

* SELECT Statements are prepared in : DataHandlerBase.makeSelect
(This use a pool of prepared statement, a new prepared statement is
created only if there is no one available on the pool).

I had to trace where Result Sets (Cursors) are Opened and Closed and
where statements are prepared and closed or checked-in (released
back to the pool).


* Caller Hierarchy of DataHandlerBase.makeSelect is as Follow :
-> DataHandlerBase.makeSelect
      !
      +----- DataHandlerBase.select (Wich actually executes the
               !           statement and returns a ResultSet)
               !
               +----DBMSToDOM.processPropertyTable (Process The
               !           ResultSet and close it immediately)
               !
               +----DBMSToDOM.processRelatedClassTable (Process The
               !           ResultSet and close it immediately)
               !
               +----DBMSToDOM.retrieveRootTableData (Process The
               !           ResultSet and close it immediately)
               !
               +----DBMSDelete.getResultSet
                     !
                     +---DBMSDelete.processRelatedClassTable (Process
                     !       the ResultSet and close it immediately)
                     !
                     +---DBMSDelete.processRootTable (Process
                             the ResultSet and close it immediately)


RESULT SETS:
------------

In all cases, Result Sets are closed as soon as all rows are
processed, but this also means that Result Sets will stay opened
until all children are processed ===> There may be too many Result
Sets (Cursors) opened only if the MAP is too "deep"...


PREPARED STATEMENTS :
---------------------

I didn't found any explicit close (or Check-in) of prepared
statements... They are checked-in only when their wrappers
(SPPreparedStatement) are garbage-collected (close() is issued from
the finalize methode)...
Since Garbage-Collecting is not a continuous process and is
depending on the JVM implementation, statements may be prepared (new
prepared statements added to the pool) more quickly than they are
checked-in ====> Max resources allowed by DB server may be reached.


SOLUTION :
==========

we have to close Statements each time we close ResultSets, but at
the time we close the ResultSet, related Statement is not available
in the code (Note that we have to close the wrapper
SPPreparedStatement which actually release-back the statement to the
pool, so we can't use ResultSet.getStatement().close())

The solution I adopted is "dirty" but has the less impact on the
code...

===> A New Class StmtResultSet

      public class StmtResultSet {
	 public ResultSet rs;
	 public PreparedStatement stmt;
	 public StmtResultSet(ResultSet rs, PreparedStatement stmt) {
		 this.rs = rs;
		 this.stmt = stmt;
	 }
      }


===> DataHandlerBase.select Return StmtResultSet instead of ResultSet

     public StmtResultSet select(Table table, Key key,
                                 Object[] keyValue, String where,
                                 Column[] paramColumns,
                                 Object[] paramValues,
                                 OrderInfo orderInfo)
                                 throws SQLException
     {
         checkState();
         PreparedStatement stmt = makeSelect(table, key, keyValue,
                       where, paramColumns, paramValues, orderInfo);
	 return new StmtResultSet(stmt.executeQuery(), stmt);
     }

===> in DBMSToDOM.processPropertyTable ,
         DBMSToDOM.processRelatedClassTable ,
         DBMSToDOM.retrieveRootTableData ,
         DBMSDelete.processRelatedClassTable ,
         DBMSDelete.processRootTable

      Replace rs.close() by something like
            stmtrs.rs.close();
            stmtrs.stmt.close();




Abdel

#3226 From: "abdelhachim" <abdelhachim@...>
Date: Mon Nov 10, 2003 1:34 pm
Subject: Re: Maximum Cursors Exceeded error in Oracle
abdelhachim
Send Email Send Email
 
Sorry, For the last time I will try to restore The indentation (it
is useful where reading Code and the Call hierarchy)

--- In xml-dbms@yahoogroups.com, "xmldbms" <rpbourret@h...> wrote:
> I have no idea what is happening, but I have a bad feeling that
the
> problem is in the DataSource/Connection/Statement pooling code. My
> guess is that this is not closing things correctly, as I have seen
> similar problems before. (Once I finish the latest set of changes,
> the next area I plan to look at is the pooling code.)
>


I don't know if it is exacltly the same issue but here is what I
found and how I resolve it :

SYMPTOMS:
=========

I use XML-DBMS 2.0 alpha 3 in RETRIEVE mode only...

I had no problem with a simple Map but when the Map became quite
complex I got a Message saying that the max number of prepared
Statements had been exceeded (256 in The IBM JDBC Driver to BD2
AS/400)...


First DIAGNOSTIC :
==================

I Opened The DB2 server Job (process) initialized for the XML-DBMS
connection on the AS400 and found that there was too many tables
(files) opened...
It Seems that DB2 open, for each prepared statement, all necessary
tables and views...
Tables that were mapped deeply in the MAP file (related class to a
related class to..) were opened too many times.


DEEP DIAGNOSTIC :
=================

I decided to examine XML-DBMS source :

* SELECT Statements are prepared in : DataHandlerBase.makeSelect
(This use a pool of prepared statement, a new prepared statement is
created only if there is no one available on the pool).

I had to trace where Result Sets (Cursors) are Opened and Closed and
where statements are prepared and closed or checked-in (released
back to the pool).


* Caller Hierarchy of DataHandlerBase.makeSelect is as Follow :
-> DataHandlerBase.makeSelect
.    !
.    +----- DataHandlerBase.select (Wich actually executes the
.             !           statement and returns a ResultSet)
.             !
.             +----DBMSToDOM.processPropertyTable (Process The
.             !           ResultSet and close it immediately)
.             !
.             +----DBMSToDOM.processRelatedClassTable (Process The
.             !           ResultSet and close it immediately)
.             !
.             +----DBMSToDOM.retrieveRootTableData (Process The
.             !           ResultSet and close it immediately)
.             !
.             +----DBMSDelete.getResultSet
.                   !
.                   +---DBMSDelete.processRelatedClassTable (Process
.                   !       the ResultSet and close it immediately)
.                   !
.                   +---DBMSDelete.processRootTable (Process
.                           the ResultSet and close it immediately)


RESULT SETS:
------------

In all cases, Result Sets are closed as soon as all rows are
processed, but this also means that Result Sets will stay opened
until all children are processed ===> There may be too many Result
Sets (Cursors) opened only if the MAP is too "deep"...


PREPARED STATEMENTS :
---------------------

I didn't found any explicit close (or Check-in) of prepared
statements... They are checked-in only when their wrappers
(SPPreparedStatement) are garbage-collected (close() is issued from
the finalize methode)...
Since Garbage-Collecting is not a continuous process and is
depending on the JVM implementation, statements may be prepared (new
prepared statements added to the pool) more quickly than they are
checked-in ====> Max resources allowed by DB server may be reached.


SOLUTION :
==========

we have to close Statements each time we close ResultSets, but at
the time we close the ResultSet, related Statement is not available
in the code (Note that we have to close the wrapper
SPPreparedStatement which actually release-back the statement to the
pool, so we can't use ResultSet.getStatement().close())

The solution I adopted is "dirty" but has the less impact on the
code...

===> A New Class StmtResultSet

.    public class StmtResultSet {
.       public ResultSet rs;
.       public PreparedStatement stmt;
.       public StmtResultSet(ResultSet rs, PreparedStatement stmt) {
.               this.rs = rs;
.               this.stmt = stmt;
.       }
.    }


===> DataHandlerBase.select Return StmtResultSet instead of ResultSet

.   public StmtResultSet select(Table table, Key key,
.                               Object[] keyValue, String where,
.                               Column[] paramColumns,
.                               Object[] paramValues,
.                               OrderInfo orderInfo)
.                               throws SQLException
.   {
.       checkState();
.       PreparedStatement stmt = makeSelect(table, key, keyValue,
.                     where, paramColumns, paramValues, orderInfo);
.       return new StmtResultSet(stmt.executeQuery(), stmt);
.   }

===> in DBMSToDOM.processPropertyTable ,
.       DBMSToDOM.processRelatedClassTable ,
.       DBMSToDOM.retrieveRootTableData ,
.       DBMSDelete.processRelatedClassTable ,
.       DBMSDelete.processRootTable

.    Replace rs.close() by something like
.          stmtrs.rs.close();
.          stmtrs.stmt.close();




Abdel

#3227 From: Charles Fulnecky <cafulnecky@...>
Date: Mon Nov 10, 2003 2:09 pm
Subject: Re: Re: Maximum Cursors Exceeded error in Oracle
cafulnecky
Send Email Send Email
 
Abdel,

Thanks for the reply, your analysis makes sense and correlates with what I am
seeing ... will try implementing your suggestions and let you know.

Charlie


abdelhachim <abdelhachim@...> wrote:
--- In xml-dbms@yahoogroups.com, "xmldbms" <rpbourret@h...> wrote:
> I have no idea what is happening, but I have a bad feeling that
the
> problem is in the DataSource/Connection/Statement pooling code. My
> guess is that this is not closing things correctly, as I have seen
> similar problems before. (Once I finish the latest set of changes,
> the next area I plan to look at is the pooling code.)
>


I don't know if it is exacltly the same issue but here is what I
found and how I resolve it :

SYMPTOMS:
=========

I use XML-DBMS 2.0 alpha 3 in RETRIEVE mode only...

I had no problem with a simple Map but when the Map became quite
complex I got a Message saying that the max number of prepared
Statements had been exceeded (256 in The IBM JDBC Driver to BD2
AS/400)...


First DIAGNOSTIC :
==================

I Opened The DB2 server Job (process) initialized for the XML-DBMS
connection on the AS400 and found that there was too many tables
(files) opened...
It Seems that DB2 open, for each prepared statement, all necessary
tables and views...
Tables that were mapped deeply in the MAP file (related class to a
related class to..) were opened too many times.


DEEP DIAGNOSTIC :
=================

I decided to examine XML-DBMS source :

* SELECT Statements are prepared in : DataHandlerBase.makeSelect
(This use a pool of prepared statement, a new prepared statement is
created only if there is no one available on the pool).

I had to trace where Result Sets (Cursors) are Opened and Closed and
where statements are prepared and closed or checked-in (released
back to the pool).




---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

[Non-text portions of this message have been removed]

#3228 From: Narayanasamy Kanakasabai <knsamy@...>
Date: Mon Nov 10, 2003 4:03 pm
Subject: Re: Re: Maximum Cursors Exceeded error in Oracle
knsamy
Send Email Send Email
 
HI ,

In JDBC, each prepare statement will consume one cursor, So you need to close
the prepared statement level.



Thanks
Samy

Charles Fulnecky <cafulnecky@...> wrote:
Abdel,

Thanks for the reply, your analysis makes sense and correlates with what I am
seeing ... will try implementing your suggestions and let you know.

Charlie


abdelhachim <abdelhachim@...> wrote:
--- In xml-dbms@yahoogroups.com, "xmldbms" <rpbourret@h...> wrote:
> I have no idea what is happening, but I have a bad feeling that
the
> problem is in the DataSource/Connection/Statement pooling code. My
> guess is that this is not closing things correctly, as I have seen
> similar problems before. (Once I finish the latest set of changes,
> the next area I plan to look at is the pooling code.)
>


I don't know if it is exacltly the same issue but here is what I
found and how I resolve it :

SYMPTOMS:
=========

I use XML-DBMS 2.0 alpha 3 in RETRIEVE mode only...

I had no problem with a simple Map but when the Map became quite
complex I got a Message saying that the max number of prepared
Statements had been exceeded (256 in The IBM JDBC Driver to BD2
AS/400)...


First DIAGNOSTIC :
==================

I Opened The DB2 server Job (process) initialized for the XML-DBMS
connection on the AS400 and found that there was too many tables
(files) opened...
It Seems that DB2 open, for each prepared statement, all necessary
tables and views...
Tables that were mapped deeply in the MAP file (related class to a
related class to..) were opened too many times.


DEEP DIAGNOSTIC :
=================

I decided to examine XML-DBMS source :

* SELECT Statements are prepared in : DataHandlerBase.makeSelect
(This use a pool of prepared statement, a new prepared statement is
created only if there is no one available on the pool).

I had to trace where Result Sets (Cursors) are Opened and Closed and
where statements are prepared and closed or checked-in (released
back to the pool).




---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

[Non-text portions of this message have been removed]


Yahoo! Groups SponsorADVERTISEMENT

To post a message, send it to: xml-dbms@yahoogroups.com
To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-dbms

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

[Non-text portions of this message have been removed]

#3229 From: qiu jianfeng <qiujf@...>
Date: Wed Nov 12, 2003 3:05 am
Subject: Use xml-dbms transfer data from rdb to xml?
qiujf_15
Send Email Send Email
 
Hi

I have to create a Mapping Model for Relational Database to XML Conversion.

My mapping model should be suitable for using Oracle and SQL Server

Databases.

I need your inputs regarding some issues like retrieving iterative XML

fragments from DB table,

I want to ask tow questions:

1, how does xml-dbms make to transfer data from db to xml, from the help doc , I
think

the steps are : create a .map file fit to the tables in db, then use commond
line like

    java TransferResultSet -s "SELECT * FROM Sales WHERE CustNumber='543'"
       sales_rs3.map sales_out.xml

is it correct?

2, In my mapping model , can I use xml-dbms to do most of the works I should to
do .


Howevr, your help regarding

this is highly appreciated.

Regards,qiujf





[Non-text portions of this message have been removed]

#3232 From: Ronald Bourret <rpbourret@...>
Date: Thu Nov 20, 2003 8:23 am
Subject: Re: Re: Newbie: some questions
xmldbms
Send Email Send Email
 
Sorry about the long delay in answering. I've been very busy.

Comments below.

e9725082 wrote:
> I want to transfer an XML document to the follwing structure
> "{ call procname( ?, ? )}".
> Its the same as for a PreparedStatement, I just use the
> CallableStatement object - everything is (almost) the same.
> I have a kind of "hack" for this problem. I "just" had to implement
> my own datahandler - and it works. In the implementation I just
> implemented the insert and selection part of the interface (delete
> makes in this context no sense). I could here reuse a lot of the
> existing code (some are just copy paste of the your original
> implementation).

Just so I understand. What you are doing is passing values stored in an
XML document to a stored procedure. For example, you might use the XML
document:

    <Name>
       <First>Ronald</First>
       <Last>Bourret</Last>
    </Name>

to pass the first and last names to a stored procedure that looks like:

    addNewPerson(firstname, lastname)

Is this correct?

> The only problem what I face now is that the order of the parameters.
> For the selection part there should be a solution because I have the
> fixed order. I have not tried it yet but I hope I can do it.
> The bigger problem what I have is the insert because here I don't
> have the orderinfo object - The columns come from a hashtable - which
> means
> Hashtable.elements -> therefore they are ordered after the java
> hashtable alg. which can be very tricky when you have to call a
> stored procedure with 20 parameters.
> Here I have only 2 possibilties - either I change the order of the
> parameters of the stored procedure (which is mostly not possible) or
> I change the names of the XML document so that the order is correct
> (not really easy).
> I can just suggest that the interface of the datahandler for
> insert/update can be so extended that there is also the orderinfo
> object avaiable - would be nice:)).

Two comments:

1) Changing the names in the XML document isn't that hard. You can just
use XSLT to perform a transformation. (Of course, this requires you to
know the Java hashing algorithm, which may be hard to find out.)

2) I looked at the latest version of the code, which is currently only
on my machine. (I've modified a lot of the code surrounding data
handlers.) It's been a while since I had time to work on this and I
didn't look too closely, but it appears that the data will be passed to
DataHandler.insert in the order it occurs in the XML document. This
should solve the problem nicely. (As usual, no guarantees about when
this code will be available :(

> The advantage of this approach is that the dtd havenot to be changed.
> The procedure name is the tablename.
>
> As far as i understand the framework (I'm just guessing now) it would
> not be possible to call stored functions, e.g.
> {?= call proc(?,?,?)}
> because for generating the result document you need a result set with
> columnname(s) - the names are necessary to generate the XML document.
> I haven't tried it now and I know too few about stored functions to
> say know if I'm right or wrong with my assumption that it will not
> work with the current XML-DMBS implementation. But thats just
> theorectical for me now. Maybe you have here more experience.

In this case, I assume you want to use the result of the function as
data to be returned in an XML document? If so, you are correct that the
result must be returned (by the DataHandler.select method) as a result
set. Note that you could probably construct this result set yourself in
your DataHandler implementation. I took a quick look at the code and it
appears that the only methods in the ResultSet interface that you need
to implement are next(), close(), wasNull(), and getObject(int).

> > > 5. I read in the 2.0 specification that there is a bug with the
> SQL
> > > Server ("can't retrieve documents nested more than one table
> > deep").
> > > Is this bug fixed or can you tell me at least the status of it.
> >
> > This bug is finally fixed, but I haven't released it yet because I
> > haven't finished all of the surrounding changes. (I also need to
> > check that I didn't close connections and introduce a bug...)
> >
> I have tried it with the alpha 3 version (but its a sql server 2000 -
> jdbc sp1 driver ) and everything work. The error description was
> sofar as i remeber for sql server 7.0.  I also tested my connection
> with
> http://groups.yahoo.com/group/xml-dbms/message/1242
>          DatabaseMetaData dbm = con.getMetaData();
>          return dbm.getMaxStatements();
> and it returned my 0 - javadoc: "a result of zero means that there is
> no limit or the limit is not known" - so this didnot tell my
> anything. But I tried it to repeat the error description in the
> messages above and it seems that it works (at least what i have
> tested).

If your driver returns 0 for getMaxStatements, then you don't need to
worry about this problem. Your driver handles it for you. The problem is
that some SQL Server drivers return 1 for getMaxStatements and XML-DBMS
requires one active statement per nesting level when building an XML
document from the database.

> > And in anticipation of your next question, I refuse to say when I
> > will release the fix -- my schedule is just to hectic to make those
> > sorts of predictions :)
> I know that you are a very busy man and I also want to thank you for
> your great project - you saved my a lot of time. My only concern
> is/was that as long it is in the alpha state that changes in the DTD
> can be made which are not backward compatible. It would be just hard
> to explain user how to change their dtds (how,why,...).

I wouldn't worry too much about DTD changes. The DTDs (especially
xmldbms2.dtd) are pretty stable. The next release has some minor changes
to Update and UpdateOrInsert in actions.dtd. I would love a nicer syntax
for filters.dtd, but haven't been able to think of one.

-- Ron

#3233 From: Ronald Bourret <rpbourret@...>
Date: Thu Nov 20, 2003 8:28 am
Subject: Re: ParserUtilsXerces
xmldbms
Send Email Send Email
 
Just a guess, but have you turned namespace processing on? See the code
in openDocument:

    factory.setNamespaceAware(true);

-- Ron

e9725082 wrote:
>
> hi!
>
> Can someone explain me when I create the Document from the normal
> xerces parser that i always get
> java.lang.IllegalArgumentException: Local name cannot be null.
>  at org.xmlmiddleware.xmlutils.XMLName.checkLocalName
> (XMLName.java:618)
>  at org.xmlmiddleware.xmlutils.XMLName.getUniversalName
> (XMLName.java:341)
>
> (Its already mentioned in http://groups.yahoo.com/group/xml-
> dbms/message/2499)
> but when i use the ParserUtilsXerces class to create the document
> (the same document) it works?
> With this code it works
> ParserUtilsXerces pars = new ParserUtilsXerces();
> Document doc =  pars.openDocument(new InputSource(new FileReader
> ("orders.xml")), false );
> but not with a normal xerces parser not?!?
>
> Have anyone an idea?
>
> gerald

#3234 From: Ronald Bourret <rpbourret@...>
Date: Thu Nov 20, 2003 8:40 am
Subject: Re: Use xml-dbms transfer data from rdb to xml?
xmldbms
Send Email Send Email
 
qiu jianfeng wrote:
>
> Hi
>
> I have to create a Mapping Model for Relational Database to XML Conversion.
>
> My mapping model should be suitable for using Oracle and SQL Server
> Databases.

Note that XML-DBMS has problems with SQL Server when transferring data
from the database to XML. XML-DBMS requires as many open result sets per
connection as there are levels in your table hierarchy, but SQL Server
only allows one open result set per connection. As a result, you can
only retrieve data from a single table.

Note that some drivers cache data locally and solve this problem for
you. To check if your driver does this, check the return value for
DatabaseMetaData.getMaxStatements(). If it is 0, you won't have a
problem. If it is 1, you will have the limitation noted above.

> I need your inputs regarding some issues like retrieving iterative XML
> fragments from DB table,
>
> I want to ask tow questions:
>
> 1, how does xml-dbms make to transfer data from db to xml, from the help doc ,
I think
> the steps are : create a .map file fit to the tables in db, then use commond
line like
>
>    java TransferResultSet -s "SELECT * FROM Sales WHERE CustNumber='543'"
>       sales_rs3.map sales_out.xml
>
> is it correct?

Yes. Comments:

1) You can also call DBMSToDOM directly from your application. For code
that does this, see TransferResultSet.

2) If your WHERE clause only uses primary key values, you can also use
Transfer. XML-DBMS will build the WHERE clause for you.

> 2, In my mapping model , can I use xml-dbms to do most of the works I should
to do .

I can't answer this question. It depends on what you want to do.

-- Ron

#3235 From: Ronald Bourret <rpbourret@...>
Date: Thu Nov 20, 2003 9:09 am
Subject: Re: Re: Maximum Cursors Exceeded error in Oracle
xmldbms
Send Email Send Email
 
Did this fix your problem?

-- Ron

Charles Fulnecky wrote:
>
> Abdel,
>
> Thanks for the reply, your analysis makes sense and correlates with what I am
seeing ... will try implementing your suggestions and let you know.
>
> Charlie

#3236 From: Ronald Bourret <rpbourret@...>
Date: Thu Nov 20, 2003 9:16 am
Subject: Re: Re: Maximum Cursors Exceeded error in Oracle
xmldbms
Send Email Send Email
 
Thanks for this information. As Abdel notes, prepared statements are
never closed except during garbage collection, so this is probably the
cause of the problem.

The question is how to trade off efficiency and database resources. If
XML-DBMS closes all prepared statements after using them, it will have
to continually reprepare statements, which is very inefficient. On the
other hand, if it doesn't close statements, there is the risk of running
out of database resources. Furthermore, it does not appear that
DatabaseMetaData can tell me how many open cursors I can have, so I
don't see a way to close statements when the database runs out of
resources.

Ideas?

-- Ron

Narayanasamy Kanakasabai wrote:
>
> HI ,
>
> In JDBC, each prepare statement will consume one cursor, So you need to close
the prepared statement level.

Messages 3205 - 3236 of 3869   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help