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 Wei Cheng <wi...@yahoo.com> on 2007/03/16 19:08:21 UTC

More on multiple datasources

This maybe discussed here before but I did not see a
clear solution so far.

I need to access multiple data source at the same
time, reading from DateSource1 and wrting to
DataSource2. Two questions:

1) Do I have to use two mapper "config" files for
this? There are objections among teammates to have two
SqlMapper config files

2) Could the connection string of a SqlMapper instance
be assigned/changed OUTSIDE the config file at
runtime?

Thanks for the information!

Wei Cheng
Canada


 
____________________________________________________________________________________
Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
http://farechase.yahoo.com/promo-generic-14795097

Re: More on multiple datasources

Posted by Atilla Ozgur <at...@gmail.com>.
I had to make changes to DomSqlMapBuilder.cs file to be able to run IBatis.

		public string ApplyDataMapperNamespacePrefix( string elementName )
		{
            return elementName;
//			return DATAMAPPER_NAMESPACE_PREFIX+ ":" + elementName.
//				Replace("/","/"+DATAMAPPER_NAMESPACE_PREFIX+":");
		}

		public static string ApplyMappingNamespacePrefix( string elementName )
		{
            return elementName;
            //return MAPPING_NAMESPACE_PREFIX+ ":" + elementName.
            //    Replace("/","/"+MAPPING_NAMESPACE_PREFIX+":");
		}

if I do not make this changes, SelectSingleNode methods does return
null. And I get NullPointerExceptions. My locale is turkish and I use
Windows XP SP2 with VS.NET 2005 SP1.

Do you have any idea? Why I had to make this changes? I think that i
am doing my configuration wrong. I copied
provider.xsd,SqlMap.xsd,SqlMapConfig.xsd files both
VS.NET schemas and I also included them with my project.

After making these patches my simple solution works as expected. I am
evaluating IBatis for my DAL. Any ideas welcome. Thank you for your
time.

Re: More on multiple datasources

Posted by Gilles Bayon <ib...@gmail.com>.
You could have one SqlMapper config file and change the datasource from 1 to
2 with someting as
http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+set+the+
connection+string+per+user+in+Web+context


On 3/16/07, Wei Cheng <wi...@yahoo.com> wrote:
>
> This maybe discussed here before but I did not see a
> clear solution so far.
>
> I need to access multiple data source at the same
> time, reading from DateSource1 and wrting to
> DataSource2. Two questions:
>
> 1) Do I have to use two mapper "config" files for
> this? There are objections among teammates to have two
> SqlMapper config files
>
> 2) Could the connection string of a SqlMapper instance
> be assigned/changed OUTSIDE the config file at
> runtime?
>
> Thanks for the information!
>
> Wei Cheng
> Canada
>
>
>
>
> ____________________________________________________________________________________
> Finding fabulous fares is fun.
> Let Yahoo! FareChase search your favorite travel sites to find flight and
> hotel bargains.
> http://farechase.yahoo.com/promo-generic-14795097
>



-- 
Cheers,
Gilles

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