Hello Andres,

Wednesday, June 16, 2004, 12:41:39 AM, you wrote:

> Can't we just solve this with an XML configuration option?

Putting the configuration option in xml does not solve the problem!
You need something in the code that handles the option!

The right place to put it is in the Dialect since it is Dialect
specific!

Note ALL other db's besides oracle can return resultsets via
executeQuery() which is the standard way inside hibernate core to get
a resultset.

And it get's messy since you both have to something different with the
statement before and after calling execute on the statement....and
those parts of hibernate does not know wether a statement is a sql or
stored procedure call.

> We
> could specify the Type we need to get through reflection.  We could
> even specify to use execute() or executeQuery() through the
> configuration.  Isn't it is better than hacking up the code?

Dude, you still need to change the code to support the option... ;)

> I
> would gladly do it myself and submit a patch.  Could you just point
> me to the package/class that it would best fit into?

follow the forun thread as the user is on the right track - but do it
in hibernate3!

> Note:
> http://forum.hibernate.org/viewtopic.php?t=11&highlight=stored+procedure
> Seems like someone did some work on this.  Did they submit it to
> cvs or somewhere so I don't have to start from scratch?

the user never returned with a patch or answer....

> I know the JDBC implementers could have done it different ways
> but I think providing a way to specify which out parameter to get
> the resultset from should be a feature.  And specifying in the XML
> mapping which type (eg. OracleTypes.CURSOR) to use doesn't seem like
> a big deal either.  But let me know if I'm wrong about that.

Remember - it is ONLY oracle that has this "misfeature" ... and do you
have stored procedures that has more than one out parameter (namely
the first one) when you return a resultset ?

Best regards,
Max

> -----Original Message-----
> From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 15, 2004 3:07 PM
> To: March, Andres
> Cc: [EMAIL PROTECTED]
> Subject: Re[2]: [Hibernate] Oracle stored procedures

> Hello Andres,

> The problem as you yourself mention is that it is Oracle specific (as
> it require an import com.oracle.jdbc.OracleTypes)

> In MS SQL Server, DB2, Interbase, Sybase, Informix you can (more or
> less) do

>> CallableStatement st = null;
>> ResultSet rs = null;
>> st = session.connection().prepareCall("{call ? := ...}");
>> st.setObject(2, optionalID);
>> rs = st.executeQuery();

> Which would be MUUCH nice since then the existing executeQuery() calls
> in hibernate core would work nicely without any "tweaks"!

> Im the only one looking into this at the moment, but you are more than
> welcome to see if you can find a better way out of this "just for
> oracle tweak".....any contribution will be welcome ;)

> /max


> Tuesday, June 15, 2004, 11:39:55 PM, you wrote:

>> This seems to work for me.  Obviously this is oracle specific but
>> we can make it extensible.  I can write all the oracle specific code
>> for this, if necessary.  I just don't want to have to deal with
>> resultsets anymore.  I have not checked out the latest Hibernate3
>> from CVS yet.  I will check it out.  Please let me know if someone
>> has gone down this path already.

>> -Andres. 

>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On Behalf Of
>> March, Andres
>> Sent: Tuesday, June 15, 2004 2:09 PM
>> To: Max Rydahl Andersen
>> Cc: [EMAIL PROTECTED]
>> Subject: RE: [Hibernate] Oracle stored procedures

>> I saw this on the forums.  Does it not work?

>> CallableStatement st = null;
>> ResultSet rs = null;
>> st = session.connection().prepareCall("{call ? := ...}");
>> st.registerOutParameter(1, OracleTypes.CURSOR);
>> st.setObject(2, optionalID);
>> st.execute();
>> rs = (ResultSet)st.getObject(1);

>> - Andres

>> -----Original Message-----
>> From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] 
>> Sent: Tuesday, June 15, 2004 1:53 PM
>> To: March, Andres
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [Hibernate] Oracle stored procedures

>> Hello Andres,

>> Tuesday, June 15, 2004, 5:49:06 PM, you wrote:

>>> I was wondering if there is any progress being made ongetting
>>> Oracle stored procedures working with hibernate CRUD queries.  I
>>> wouldlike to help out in this area if possible.  One of the things I
>>> would like tobe able to do is specify one of the out parameters to
>>> be used as the resultset.

>> Hibernate3 has support for CUD operations in stored procedures.

>> R as in Read has not been implemented as at the moment the team
>> haven't found a good way (read standard) to get a out parameter as a
>> resultset.

>> Do you know a way ? ;)

>> (note: it actually seems like Oracle is the only major player who
>> don't have proper out parameter as resultset support - which I find
>> kind of weird ;)

>> /max

>>>  

>>> -----------------------------------------

>>> Andres March

>>> Platform - Apps Engineering

>>> Sony Online Entertainment

>>> desk: 858.577.3373

>>> cell:   619.519.1519

>>>  













-- 
Best regards,
 Max                            mailto:[EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to