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

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problem generating XML output when using c3p0 with Hibernate
PostPosted: Tue Oct 04, 2005 10:17 am 
Newbie

Joined: Tue Oct 04, 2005 9:41 am
Posts: 2
I have a java class that exports some data from Oracle as XML. During development, I didn't specifically use connection pooling, but added the relevant settings and files for c3p0 when deployed to production.

Without the c3p0 settings (specified below), my XML file looks like this:
Code:
<?xml version = '1.0'?>
<DATA>
   <RECORD num="1">
      <RECORD_ID>110</RECORD_ID>
      <FILE_LIST>
         <FILE_LIST_ROW num="1">
            <FILE_ID>113</FILE_ID>
            <ORIG_FILE_NAME>README.txt</ORIG_FILE_NAME>
            <FILE_DESCRIPTION>Some misc. readme file from the filesystem</FILE_DESCRIPTION>
            <PATH>attachments\E0110\README.txt</PATH>
         </FILE_LIST_ROW>
         <FILE_LIST_ROW num="2">
            <FILE_ID>114</FILE_ID>
            <ORIG_FILE_NAME>browserconfig.properties</ORIG_FILE_NAME>
            <FILE_DESCRIPTION>Firefox browser config file</FILE_DESCRIPTION>
            <PATH>attachments\E0110\browserconfig.properties</PATH>
         </FILE_LIST_ROW>
      </FILE_LIST>
   </RECORD>
</DATA>


Once I added the c3p0 settings in the hibernate config file, my XML looked like this:

Code:
<?xml version = '1.0'?>
<DATA>
   <RECORD num="1">
      <RECORD_ID>110</RECORD_ID>
      <FILE_LIST>oracle.jdbc.driver.OracleResultSetImpl@106870c</FILE_LIST>
   </RECORD>
<DATA>



Anyone have any ideas why this might be?

I am using Hibernate 2.x
My hibernate.cfg.xml file:
Code:
<hibernate-configuration>

   <session-factory>
      <!-- properties -->
      <property name="connection.username">esub</property>
      <property name="connection.url">
         jdbc:oracle:thin:@DHSDEV01:1521:DHSDEVQA
      </property>
      <property name="dialect">
         net.sf.hibernate.dialect.Oracle9Dialect
      </property>
      <property name="connection.password">esub</property>
      <property name="connection.driver_class">
         oracle.jdbc.driver.OracleDriver
      </property>

      <!--  Connection Pool Properties -->
      <property name="c3p0.acquire_increment">3</property>
      <property name="c3p0.idle_test_period">100</property>
      <!-- seconds -->
      <property name="c3p0.max_size">25</property>
      <property name="c3p0.max_statements">0</property>
      <property name="c3p0.min_size">10</property>
      <property name="c3p0.timeout">100</property><!-- seconds -->

      <!-- mapping files removed for brevity -->      


   </session-factory>

</hibernate-configuration>


Snippet of code used to get the XML data:
Code:
session = HibernateSessionFactory.currentSession();
         OracleXMLQuery qry = new OracleXMLQuery(session.connection(), sqlQuery);
         qry.setRowsetTag("ESUBMISSION_DATA");
         qry.setRowTag("ESUBMISSION_RECORD");
           
         String xmlString = qry.getXMLString();


NOTE: sqlQuery omitted for brevity, however it DOES use a CURSOR -not sure if this is relevant as I'm a sql noob.

No exceptions generated, no errors reported. Anybody have any ideas?

Thanks in advance,
Phill


Top
 Profile  
 
 Post subject: Update to OracleXMLQuery/c3p0 and Hibernate
PostPosted: Thu Oct 06, 2005 10:33 pm 
Newbie

Joined: Tue Oct 04, 2005 9:41 am
Posts: 2
Okay, I understand that the Cursor is returning a resultset as the FILE_LIST column. This makes sense as I have a list of files for each record.

What I don't understand is why Hibernate's default connection pooling fetches the contents of the resultset while a production-ready connection pool implementation does not.

Can anyone shed some light on what differences there are between the two?
I tried using proxool and got the same results as I got with c3p0.

Could it be a caching issue? I am thinking (hoping) that there must be a configuration parameter that makes the two behave differently given the same data. Has anyone done anything similar to this. Exporting the contents of a database as XML shouldn't be this much of a problem should it?

Somebody, Anybody...HELP!!!!


Top
 Profile  
 
 Post subject: Re: Problem generating XML output when using c3p0 with Hibernate
PostPosted: Tue Jan 24, 2017 9:25 am 
Newbie

Joined: Tue Jan 24, 2017 9:20 am
Posts: 1
Hello,
I'm facing exactly the same problem that you've encountered. I don't found any solutions on the web, did you find a way to use a connection pool with cursors in OracleXmlQuery ?
I hope you have an answer ...
Thanks,


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

All times are UTC - 5 hours [ DST ]


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

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