ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Pablo Araya <juanpablo.ar...@gmail.com>
Subject Re: IbatisNet,Ibatis DataAccess and Connection Pooling
Date Mon, 10 May 2010 17:00:45 GMT
We use two SqlMap.configs in this case, and two Mapper class, based on:

http://ibatis.apache.org/docs/dotnet/datamapper/ch04s04.html

Under the InitMapper() method, we set the direction of the sql for one
or another config:


-- For MapperFirst.cs---

        protected static void InitMapper()
        {
            DomSqlMapBuilder builder = new DomSqlMapBuilder();
            XmlDocument sqlMapConfig =
Resources.GetEmbeddedResourceAsXmlDocument("Config.sqlMapFirst.config,
Dyt.Polla.CodigoBarras.DataSource");
            _Mapper = builder.Configure(sqlMapConfig) as SqlMapper;
        }

-- For MapperSecond.cs---
        protected static void InitMapper()
        {
            DomSqlMapBuilder builder = new DomSqlMapBuilder();
            XmlDocument sqlMapConfig =
Resources.GetEmbeddedResourceAsXmlDocument("Config.sqlMapSecond.config,
Dyt.Polla.CodigoBarras.DataSource");
            _Mapper = builder.Configure(sqlMapConfig) as SqlMapper;
        }

Then under ibatis, you just use:

MapperFirst.Instance().Queryfor....
MapperSecond.Instance().Queryfor....

Greetings and sorry for  my poor english!

2010/5/10 Michael McCurrey <mmccurrey@gmail.com>:
> Your connection pooling should be handled through your ado.net connection
> string; both SQL Server and Sybase have configuration options for this.
> I personally use the Castle project for my IOC framework and it works really
> well.
>
> On Mon, May 10, 2010 at 2:10 AM, Chetan V Minajagi
> <chetan.v.minajagi@jpmchase.com> wrote:
>>
>> Hi,
>>
>> We have an application where we need to connect to two different databases
>> SQL server and Sybase.
>> We feel using ibatisNet Data Access we can configure connections to these
>> two datasources and will be able to have a nice way of seamlessly connecting
>> to multiple homogenous databases.
>>
>>
>> Also we are planning to use Enterprise Library for most things.Still not
>> sure which one Spring.Net /Enterprise library to pick though.
>>
>> Either way if we use any of the two can you please let us know how to
>> configure ibatis configurations through this.Especially how do we use
>> connection pooling.
>>
>> Can any one of you suggest a nice way of doing this?
>>
>> Warm Regards,
>> Chetan
>>
>> This communication is for informational purposes only. It is not intended
>> as an offer or solicitation for the purchase or sale of any financial
>> instrument or as an official confirmation of any transaction. All market
>> prices, data and other information are not warranted as to completeness or
>> accuracy and are subject to change without notice. Any comments or
>> statements made herein do not necessarily reflect those of JPMorgan Chase &
>> Co., its subsidiaries and affiliates. This transmission may contain
>> information that is privileged, confidential, legally privileged, and/or
>> exempt from disclosure under applicable law. If you are not the intended
>> recipient, you are hereby notified that any disclosure, copying,
>> distribution, or use of the information contained herein (including any
>> reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any
>> attachments are believed to be free of any virus or other defect that might
>> affect any computer system into which it is received and opened, it is the
>> responsibility of the recipient to ensure that it is virus free and no
>> responsibility is accepted by JPMorgan Chase & Co., its subsidiaries and
>> affiliates, as applicable, for any loss or damage arising in any way from
>> its use. If you received this transmission in error, please immediately
>> contact the sender and destroy the material in its entirety, whether in
>> electronic or hard copy format. Thank you. Please refer to
>> http://www.jpmorgan.com/pages/disclosures for disclosures relating to
>> European legal entities.
>
>
> --
> Michael J. McCurrey
> Read with me at http://www.mccurrey.com
> http://chaoticmindramblings.blogspot.com/
>



-- 
Juan Pablo Araya
787 76 034

---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-cs-help@ibatis.apache.org


Mime
View raw message