-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem in using XMLType with Hibernate
PostPosted: Mon May 28, 2007 12:30 pm 
Newbie

Joined: Wed May 16, 2007 1:01 pm
Posts: 2
We are facing one issue while using Hibernate with Oracle XMLType Data type.



Development Environment:

Weblogic 8.1 SP4,

Oracle 10g

Hibernate 3.0

Spring 2.0.4



Requirement: To insert/retrieve XML into XMLType column (Oracle 10g) through Hibernate.



We have got sample implementation of Oracle XMLType for Weblogic as a Container on Hibernate.org (http://www.hibernate.org/369.html)

While implementing code mentioned in the link, we are getting ClassCasteException:weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl



In implementation of public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException

We are getting OracleResultSet which is wrapped by weblogic.jdbc.wrapper.ResultSet. Following is code snippet.


Code:
public Object nullSafeGet( ResultSet rs, String [ ] names, Object arg2 ) throws HibernateException, SQLException {
        OracleResultSet ors = null;

        if ( rs instanceof weblogic.jdbc.wrapper.ResultSet ) {

            ors = (OracleResultSet) getNativeResultSet ( rs ); //getting ClassCastException

        } else if ( rs instanceof OracleResultSet ) {

            ors = (OracleResultSet) rs;

        } else {

            throw new UnsupportedOperationException (

                    "Only direct support for Weblogic and Oracle drivers. Please check your pool driver." );

        }

OPAQUE op = ors.getOPAQUE(names[0]);

oracle.xdb.XMLType xt= oracle.xdb.XMLType.createXML(op);

org.w3c.dom.Document doc = (org.w3c.dom.Document) xt.getDocument();

return (org.w3c.dom.Document) doc;

    }


getNativeResultSet () is implementation method of org.springframework.jdbc.support.nativejdbc.WeblogicNativeJdbcExtracor



We are not finding proper solution for the problem. I believe it is issue with OracleResultSet and Weblogic Result set mapping issue. However we are not finding right direction in resolving it.

It would be great help if someone can help us in resolving the issue.


Thanks
Chintan


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.