You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by "Dmitry Y. Bugaychenko" <Dm...@tepkom.ru> on 2007/10/15 19:55:20 UTC

Multiple result sets and XML parameters for stored procedures

Hi All

I'm now looking for the best mapping tool for .NET to choose for our product
and iBATIS looks very promising. However, there are two questions whish
bothers me and would appreciate very much if somebody clarify them.

The first question is that in our database we have stored procedures that
return multiple results consisting of several tables. This data describes
the tree of objects of different kinds. Can I handle this situation with
iBATIS? I found very similar feature in the list of undocumented features,
so I suppose that it is possible.

An the second question is related to XML parameters for stored procedures.
Again, we have a stored procedures which takes an object tree serialized
into XML as input parameter. Can I somehow call such procedure using iBATIS?

Best regards,
Dmitry


Re: Multiple result sets and XML parameters for stored procedures

Posted by Gilles Bayon <ib...@gmail.com>.
I have just commit a unit test showing how to use an XML input parameter,
search a unit test named TestXMLParameter using the store procedure
SelectAccountViaXML

-- 
Cheers,
Gilles

<a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE">Wish List</a>

RE: Multiple result sets and XML parameters for stored procedures

Posted by Andrea Tassinari <an...@i-mconsulting.com>.
Hello,

I had the same issue and I came out with this (It was very hard to find):

ISqlMapper _mapper = null;
..
ConfigureHandler handler = new ConfigureHandler(Configure);
DomSqlMapBuilder builder = new DomSqlMapBuilder();
_mapper = builder.ConfigureAndWatch(configFilePath, handler);

//this is the juicy line!
_mapper.SessionStore = new HybridWebThreadSessionStore(_mapper.Id);



Hope this helps

Regards,
Andrea

At 15.19 16/10/2007, Vincent Apesa wrote:

>Hello All,
>  I hope one of you has come across this problem and can provide some insight.
> 
>I am attempting to run a process using an thread after a user clicks a button in our web application. The process takes a long time so kicking it off and doing something else is good.
> 
>When I attempt to run the process Ibatis throw the following exception:
>WebSessionStore: Could not obtain reference to HttpContext at IBatisNet.DataAccess.SessionStore.WebSessionStore.ObtainSessionContext()
>at IBatisNet.DataAccess.SessionStore.WebSessionStore.get_LocalSession()
>at IBatisNet.DataAccess.Configuration.DaoProxy.Intercept(IInvocation invocation, Object[] arguments)
> 
>Any help would be great!
>thanks,
>Vince
>
>
>----------
>Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare! <http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews>Try now! 
>
>No virus found in this incoming message.
>Checked by AVG Free Edition. 
>Version: 7.5.488 / Virus Database: 269.14.12/1072 - Release Date: 15/10/2007 17.55


RE: Multiple result sets and XML parameters for stored procedures

Posted by Vincent Apesa <va...@hotmail.com>.

Hello All,
  I hope one of you has come across this problem and can provide some insight.
 
I am attempting to run a process using an thread after a user clicks a button in our web application. The process takes a long time so kicking it off and doing something else is good.
 
When I attempt to run the process Ibatis throw the following exception:
WebSessionStore: Could not obtain reference to HttpContext at IBatisNet.DataAccess.SessionStore.WebSessionStore.ObtainSessionContext()
at IBatisNet.DataAccess.SessionStore.WebSessionStore.get_LocalSession()
at IBatisNet.DataAccess.Configuration.DaoProxy.Intercept(IInvocation invocation, Object[] arguments)
 
Any help would be great!
thanks,
Vince
_________________________________________________________________
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

Re: Multiple result sets and XML parameters for stored procedures

Posted by Gilles Bayon <ib...@gmail.com>.
Question a)
 IList list = sqlMap.QueryForList("GetMultipleResultClass", null); from Unit
tests

    <select id="GetMultipleResultMap"
      resultMap="account-result, Category-result">
      select
      Account_ID,
      Account_FirstName,
      Account_LastName,
      Account_Email,
      Account_Banner_Option,
      Account_Cart_Option
      from Accounts
      where Account_ID = 1;

      select
      Category_ID,
      Category_Name,
      Category_Guid
      from Categories
      where Category_ID = 1
    </select>


Question b)
Try to specify the dbType="NText" in (SqlDbType.NText)


-- 
Cheers,
Gilles

<a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE">Wish List</a>