Callable result feature

5 views
Skip to first unread message

Fabio Maulo

unread,
Feb 9, 2009, 10:18:54 AM2/9/09
to nhibernate-...@googlegroups.com
H3 has a feature named "callable" used for certain Dialects as for example Oracle.
In their implementation, each time a IDataReader is needed, they are asking for "callable" to choose which ResultSet getter is needed.
To be clear...
Suppose you have a StoredProcedure that are returning a ResultSet, the custom query are:
- MsSQL : exec selectAllEmployments
- MySQL : call selectAllEmployments()
- ORACLE : call selectAllEmployments()

For all, BUT ORACLE, you can use IDbCommand.ExecuteReader.
ORACLE DataProviders has a "special behavior" (REF_CURSOR stuff).

I tried to configure my mind to solve the problem in the same way H3 do but... I can't (too much "if" in too much places).

The real underling problem is the DataProvider that, in term of NH mean the Drive.
In my mind the Drive is the responsible to recognize a "callable" query and is the responsible to return a valid IDataReader implementation.

If there is not opposition I will go ahead with this deviation from H3 implementation.

--
Fabio Maulo

Ayende Rahien

unread,
Feb 9, 2009, 2:07:32 PM2/9/09
to nhibernate-...@googlegroups.com
Hm,
If I understand you correctly, we are talking about making the drive responsible for returning the IDataReader from a query.
In Oracle's case, it will be a data reader on top of ref cursor, right?

Fabio Maulo

unread,
Feb 9, 2009, 5:26:25 PM2/9/09
to nhibernate-...@googlegroups.com
In case of Oracle and probably some other RDBMS+DataProvider, yes you are right.
In practice, in Oracle, the Drive must recognize a StoredProcedure which will return a RefCurson in a output parameter and then do what is needed to return a IDataReader as expected.

2009/2/9 Ayende Rahien <aye...@ayende.com>



--
Fabio Maulo
Reply all
Reply to author
Forward
0 new messages