springnet-commits Mailing List for Spring Framework .NET (Page 21)
Brought to you by:
aseovic,
markpollack
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(33) |
Aug
(163) |
Sep
(491) |
Oct
(289) |
Nov
(336) |
Dec
(84) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(227) |
Feb
(413) |
Mar
(128) |
Apr
(232) |
May
(92) |
Jun
(299) |
Jul
(386) |
Aug
(228) |
Sep
(237) |
Oct
(426) |
Nov
(325) |
Dec
(405) |
2006 |
Jan
(315) |
Feb
(311) |
Mar
(152) |
Apr
(177) |
May
(443) |
Jun
(92) |
Jul
(88) |
Aug
(80) |
Sep
(288) |
Oct
(515) |
Nov
(1049) |
Dec
(440) |
2007 |
Jan
(179) |
Feb
(406) |
Mar
(294) |
Apr
(80) |
May
(432) |
Jun
(242) |
Jul
(452) |
Aug
(710) |
Sep
(206) |
Oct
(240) |
Nov
(65) |
Dec
(227) |
2008 |
Jan
(80) |
Feb
(90) |
Mar
(98) |
Apr
(136) |
May
(101) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Erich E. <oak...@us...> - 2008-01-14 20:49:59
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aop/Framework In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32236/test/Spring/Spring.Aop.Tests/Aop/Framework Modified Files: ProxyFactoryTests.cs Log Message: fix for SPRNET-847, SPRNET-846 Index: ProxyFactoryTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ProxyFactoryTests.cs 30 May 2007 22:36:13 -0000 1.20 --- ProxyFactoryTests.cs 14 Jan 2008 20:49:47 -0000 1.21 *************** *** 292,296 **** pf.AddAdvice(nop); pf.AddAdvisor(advisor); ! NopInterceptor nop2 = new NopInterceptor(); pf.AddAdvice(nop2); ITestObject proxied = (ITestObject) pf.GetProxy(); --- 292,296 ---- pf.AddAdvice(nop); pf.AddAdvisor(advisor); ! NopInterceptor nop2 = new NopInterceptor(2); // make instance unique (see SPRNET-847) pf.AddAdvice(nop2); ITestObject proxied = (ITestObject) pf.GetProxy(); *************** *** 383,386 **** --- 383,399 ---- } + [Test] + public void IgnoresAdvisorDuplicates() + { + CountingBeforeAdvice cba1 = new CountingBeforeAdvice(); + IAdvisor advisor1 = new DefaultPointcutAdvisor(cba1); + + AdvisedSupport advSup = new AdvisedSupport(); + advSup.AddAdvisor(advisor1); + advSup.AddAdvisor(advisor1); + + Assert.AreEqual(1, advSup.Advisors.Length); + } + private class AnonymousClassTimeStamped : ITimeStamped { *************** *** 488,492 **** { NopInterceptor di = new NopInterceptor(); ! NopInterceptor diUnused = new NopInterceptor(); ProxyFactory factory = new ProxyFactory(new TestObject()); factory.AddAdvice(0, di); --- 501,505 ---- { NopInterceptor di = new NopInterceptor(); ! NopInterceptor diUnused = new NopInterceptor(1); // // make instance unique (see SPRNET-847) ProxyFactory factory = new ProxyFactory(new TestObject()); factory.AddAdvice(0, di); |
From: Erich E. <oak...@us...> - 2008-01-14 20:49:59
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32236/src/Spring/Spring.Aop/Aop/Support Modified Files: AbstractPointcutAdvisor.cs Log Message: fix for SPRNET-847, SPRNET-846 Index: AbstractPointcutAdvisor.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Support/AbstractPointcutAdvisor.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractPointcutAdvisor.cs 10 Aug 2007 17:45:44 -0000 1.1 --- AbstractPointcutAdvisor.cs 14 Jan 2008 20:49:47 -0000 1.2 *************** *** 125,129 **** public override bool Equals(object o) { ! if (!(o is DefaultPointcutAdvisor)) { return false; --- 125,129 ---- public override bool Equals(object o) { ! if (!(o is AbstractPointcutAdvisor)) { return false; *************** *** 157,161 **** public override int GetHashCode() { ! return base.GetHashCode() + 13 * (Pointcut == null ? 0 : Pointcut.GetHashCode()) + 27 * (Advice == null ? 0 : Advice.GetHashCode()); --- 157,161 ---- public override int GetHashCode() { ! return 0 // (SPRNET-847) base.GetHashCode() + 13 * (Pointcut == null ? 0 : Pointcut.GetHashCode()) + 27 * (Advice == null ? 0 : Advice.GetHashCode()); |
From: Mark P. <mar...@us...> - 2008-01-14 17:52:00
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/lib/net/2.0 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27798/2.0 Added Files: Castle.DynamicProxy.dll IBatisNet.Common.Logging.Log4Net.dll IBatisNet.Common.dll IBatisNet.DataAccess.dll IBatisNet.DataMapper.dll log4net.dll Log Message: updates to compile against latest ibatis release --- NEW FILE: Castle.DynamicProxy.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: IBatisNet.DataMapper.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: IBatisNet.Common.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: IBatisNet.Common.Logging.Log4Net.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: log4net.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: IBatisNet.DataAccess.dll --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2008-01-14 17:52:00
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/lib/net/1.1 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27798/1.1 Added Files: IBatisNet.Common.Logging.Log4Net.dll log4net.dll Log Message: updates to compile against latest ibatis release --- NEW FILE: IBatisNet.Common.Logging.Log4Net.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: log4net.dll --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2008-01-14 17:49:05
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/src/Spring/Spring.IBatis/IBatis In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26544/src/Spring/Spring.IBatis/IBatis Modified Files: DaoFactoryObject.cs DaoManagerFactoryObject.cs SqlMapperFactoryObject.cs Log Message: updates to compile against latest ibatis release Index: DaoManagerFactoryObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/src/Spring/Spring.IBatis/IBatis/DaoManagerFactoryObject.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DaoManagerFactoryObject.cs 19 May 2006 21:01:30 -0000 1.1 --- DaoManagerFactoryObject.cs 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 95,101 **** } ! private DaoManager GetDefaultDao() { ! DaoManager manager = null; if (StringUtils.HasText(DefaultDaoName)) { --- 95,101 ---- } ! private IDaoManager GetDefaultDao() { ! IDaoManager manager = null; if (StringUtils.HasText(DefaultDaoName)) { Index: SqlMapperFactoryObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/src/Spring/Spring.IBatis/IBatis/SqlMapperFactoryObject.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SqlMapperFactoryObject.cs 19 May 2006 21:01:30 -0000 1.1 --- SqlMapperFactoryObject.cs 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 127,131 **** protected override object CreateUsingCustomConfig() { ! SqlMapper mapper = null; if (ConfigWatcher != null) { --- 127,131 ---- protected override object CreateUsingCustomConfig() { ! ISqlMapper mapper = null; if (ConfigWatcher != null) { Index: DaoFactoryObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/src/Spring/Spring.IBatis/IBatis/DaoFactoryObject.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DaoFactoryObject.cs 19 May 2006 21:01:30 -0000 1.1 --- DaoFactoryObject.cs 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 112,116 **** /// </remarks> /// <seealso cref="IBatisNet.DataAccess.DaoManager.GetInstance()"/> ! public DaoManager Manager { get { return _daoManager == null ? DaoManager.GetInstance() : _daoManager ; } --- 112,116 ---- /// </remarks> /// <seealso cref="IBatisNet.DataAccess.DaoManager.GetInstance()"/> ! public IDaoManager Manager { get { return _daoManager == null ? DaoManager.GetInstance() : _daoManager ; } *************** *** 119,123 **** private Type _daoInterfaceType; ! private DaoManager _daoManager; } } \ No newline at end of file --- 119,123 ---- private Type _daoInterfaceType; ! private IDaoManager _daoManager; } } \ No newline at end of file |
From: Mark P. <mar...@us...> - 2008-01-14 17:49:05
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26544 Modified Files: Spring.IBatis.build Log Message: updates to compile against latest ibatis release Index: Spring.IBatis.build =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/Spring.IBatis.build,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.IBatis.build 19 May 2006 21:01:29 -0000 1.1 --- Spring.IBatis.build 14 Jan 2008 17:48:58 -0000 1.2 *************** *** 14,21 **** <property name="build-examples" value="false"/> ! <property name="build-tests" value="true"/> ! <property name="build-integration-tests" value="true"/> - <property name="compile-net-2.0" value="false"/> <!-- Include spring helpers --> --- 14,22 ---- <property name="build-examples" value="false"/> ! <property name="build-tests" value="false"/> ! <property name="build-integration-tests" value="false"/> ! ! <property name="compile-net-1.0" value="false"/> <!-- Include spring helpers --> |
From: Mark P. <mar...@us...> - 2008-01-14 17:49:05
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Integration.Tests/IBatis In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26544/test/Spring/Spring.IBatis.Integration.Tests/IBatis Modified Files: AppContext.xml CreditTest.cs Log Message: updates to compile against latest ibatis release Index: CreditTest.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Integration.Tests/IBatis/CreditTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CreditTest.cs 19 May 2006 21:01:31 -0000 1.1 --- CreditTest.cs 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 49,53 **** BasicConfigurator.Configure(); ctx = ! new XmlApplicationContext("assembly://Spring.IBatis.Integration.Tests/Spring.IBatisNet/AppContext.xml"); } --- 49,53 ---- BasicConfigurator.Configure(); ctx = ! new XmlApplicationContext("assembly://Spring.IBatis.Integration.Tests/Spring.IBatis/AppContext.xml"); } Index: AppContext.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Integration.Tests/IBatis/AppContext.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AppContext.xml 19 May 2006 21:01:31 -0000 1.1 --- AppContext.xml 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 2,6 **** <objects xmlns='http://www.springframework.net'> ! <object id="sqlMapper" type="Spring.IBatisNet.SqlMapperFactoryObject, Spring.IBatisNet"> <property name="ConfigLocation" value="SqlMap.config"/> </object> --- 2,6 ---- <objects xmlns='http://www.springframework.net'> ! <object id="sqlMapper" type="Spring.IBatis.SqlMapperFactoryObject, Spring.IBatis"> <property name="ConfigLocation" value="SqlMap.config"/> </object> |
From: Mark P. <mar...@us...> - 2008-01-14 17:49:03
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Integration.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26544/test/Spring/Spring.IBatis.Integration.Tests Modified Files: Spring.IBatis.Integration.Tests.2005.csproj db.properties Log Message: updates to compile against latest ibatis release Index: Spring.IBatis.Integration.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Integration.Tests/Spring.IBatis.Integration.Tests.2005.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.IBatis.Integration.Tests.2005.csproj 19 May 2006 21:01:31 -0000 1.1 --- Spring.IBatis.Integration.Tests.2005.csproj 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 1,3 **** ! <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> --- 1,3 ---- ! <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> *************** *** 29,36 **** --- 29,64 ---- </PropertyGroup> <ItemGroup> + <Reference Include="Castle.DynamicProxy, Version=1.1.5.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\net\2.0\Castle.DynamicProxy.dll</HintPath> + </Reference> + <Reference Include="IBatisNet.Common, Version=1.6.1.0, Culture=neutral, PublicKeyToken=ed781d9fc396c6ca, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\net\2.0\IBatisNet.Common.dll</HintPath> + </Reference> + <Reference Include="IBatisNet.Common.Logging.Log4Net, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\net\2.0\IBatisNet.Common.Logging.Log4Net.dll</HintPath> + </Reference> + <Reference Include="IBatisNet.DataAccess, Version=1.9.1.0, Culture=neutral, PublicKeyToken=ed781d9fc396c6ca, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\net\2.0\IBatisNet.DataAccess.dll</HintPath> + </Reference> + <Reference Include="IBatisNet.DataMapper, Version=1.6.1.0, Culture=neutral, PublicKeyToken=ed781d9fc396c6ca, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\net\2.0\IBatisNet.DataMapper.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\net\2.0\log4net.dll</HintPath> + </Reference> <Reference Include="nunit.framework, Version=2.2.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath> </Reference> + <Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\net\2.0\Spring.Core.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> *************** *** 38,42 **** </ItemGroup> <ItemGroup> ! <Compile Include="Class1.cs" /> </ItemGroup> <ItemGroup> --- 66,71 ---- </ItemGroup> <ItemGroup> ! <Compile Include="IBatis\Credit.cs" /> ! <Compile Include="IBatis\CreditTest.cs" /> </ItemGroup> <ItemGroup> *************** *** 47,50 **** --- 76,93 ---- </ItemGroup> <ItemGroup> + <EmbeddedResource Include="IBatis\AppContext.xml" /> + </ItemGroup> + <ItemGroup> + <None Include="db.properties"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="providers.config"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="SqlMap.config"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> + <ItemGroup> <Folder Include="Properties\" /> </ItemGroup> Index: db.properties =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Integration.Tests/db.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db.properties 19 May 2006 21:01:31 -0000 1.1 --- db.properties 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 5,8 **** <add key="password" value="" /> <add key="username" value="" /> ! <add key="path.to.access.database" value="D:\dev\bench\Sandbox\Spring.mdb" /> </settings> \ No newline at end of file --- 5,8 ---- <add key="password" value="" /> <add key="username" value="" /> ! <add key="path.to.access.database" value="L:\projects\Spring.Net.Integration\projects\Spring.IBatis\test\Spring\Spring.IBatis.Tests\Spring.mdb" /> </settings> \ No newline at end of file |
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/lib/net/1.1 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26544/lib/net/1.1 Modified Files: Castle.DynamicProxy.dll IBatisNet.Common.dll IBatisNet.DataAccess.dll IBatisNet.DataMapper.dll Log Message: updates to compile against latest ibatis release Index: IBatisNet.DataMapper.dll =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/lib/net/1.1/IBatisNet.DataMapper.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsRd9AaN and /tmp/cvsgSsbYI differ Index: Castle.DynamicProxy.dll =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/lib/net/1.1/Castle.DynamicProxy.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsrNgpT1 and /tmp/cvsxMJF1X differ Index: IBatisNet.Common.dll =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/lib/net/1.1/IBatisNet.Common.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsZX2S39 and /tmp/cvsweaZl6 differ Index: IBatisNet.DataAccess.dll =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/lib/net/1.1/IBatisNet.DataAccess.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvstheRme and /tmp/cvsKoAcPa differ |
From: Mark P. <mar...@us...> - 2008-01-14 17:49:03
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26544/test/Spring/Spring.IBatis.Tests Modified Files: Spring.IBatis.Tests.2005.csproj Log Message: updates to compile against latest ibatis release Index: Spring.IBatis.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/test/Spring/Spring.IBatis.Tests/Spring.IBatis.Tests.2005.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.IBatis.Tests.2005.csproj 19 May 2006 21:01:31 -0000 1.1 --- Spring.IBatis.Tests.2005.csproj 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 1,3 **** ! <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> --- 1,3 ---- ! <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> *************** *** 62,68 **** </ItemGroup> <ItemGroup> - <Compile Include="Class1.cs" /> - </ItemGroup> - <ItemGroup> <ProjectReference Include="..\..\..\src\Spring\Spring.IBatis\Spring.IBatis.2005.csproj"> <Project>{F1DC54A0-86C6-4ACA-B047-86D1AD5E3447}</Project> --- 62,65 ---- |
From: Mark P. <mar...@us...> - 2008-01-14 17:49:02
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/src/Spring/Spring.IBatis In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26544/src/Spring/Spring.IBatis Modified Files: Spring.IBatis.2005.csproj Log Message: updates to compile against latest ibatis release Index: Spring.IBatis.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.IBatis/src/Spring/Spring.IBatis/Spring.IBatis.2005.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.IBatis.2005.csproj 19 May 2006 21:01:30 -0000 1.1 --- Spring.IBatis.2005.csproj 14 Jan 2008 17:48:59 -0000 1.2 *************** *** 1,3 **** ! <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> --- 1,3 ---- ! <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> *************** *** 34,38 **** <HintPath>..\..\..\lib\net\2.0\antlr.runtime.dll</HintPath> </Reference> ! <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\lib\net\2.0\log4net.dll</HintPath> --- 34,58 ---- <HintPath>..\..\..\lib\net\2.0\antlr.runtime.dll</HintPath> </Reference> ! <Reference Include="Castle.DynamicProxy, Version=1.1.5.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> ! <SpecificVersion>False</SpecificVersion> ! <HintPath>..\..\..\lib\net\2.0\Castle.DynamicProxy.dll</HintPath> ! </Reference> ! <Reference Include="IBatisNet.Common, Version=1.6.1.0, Culture=neutral, PublicKeyToken=ed781d9fc396c6ca, processorArchitecture=MSIL"> ! <SpecificVersion>False</SpecificVersion> ! <HintPath>..\..\..\lib\net\2.0\IBatisNet.Common.dll</HintPath> ! </Reference> ! <Reference Include="IBatisNet.Common.Logging.Log4Net, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> ! <SpecificVersion>False</SpecificVersion> ! <HintPath>..\..\..\lib\net\2.0\IBatisNet.Common.Logging.Log4Net.dll</HintPath> ! </Reference> ! <Reference Include="IBatisNet.DataAccess, Version=1.9.1.0, Culture=neutral, PublicKeyToken=ed781d9fc396c6ca, processorArchitecture=MSIL"> ! <SpecificVersion>False</SpecificVersion> ! <HintPath>..\..\..\lib\net\2.0\IBatisNet.DataAccess.dll</HintPath> ! </Reference> ! <Reference Include="IBatisNet.DataMapper, Version=1.6.1.0, Culture=neutral, PublicKeyToken=ed781d9fc396c6ca, processorArchitecture=MSIL"> ! <SpecificVersion>False</SpecificVersion> ! <HintPath>..\..\..\lib\net\2.0\IBatisNet.DataMapper.dll</HintPath> ! </Reference> ! <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\lib\net\2.0\log4net.dll</HintPath> *************** *** 51,54 **** --- 71,80 ---- </ItemGroup> <ItemGroup> + <Compile Include="IBatis\AbstractIBatisFactoryObject.cs" /> + <Compile Include="IBatis\DaoFactoryObject.cs" /> + <Compile Include="IBatis\DaoManagerFactoryObject.cs" /> + <Compile Include="IBatis\SqlMapperFactoryObject.cs" /> + </ItemGroup> + <ItemGroup> <Folder Include="Properties\" /> </ItemGroup> |
From: Bruno B. <bb...@us...> - 2008-01-10 16:37:57
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15157 Modified Files: ConfigurationUtils.cs Log Message: Removed extra caracter '/' in a section name. Index: ConfigurationUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util/ConfigurationUtils.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConfigurationUtils.cs 17 Feb 2007 08:28:12 -0000 1.4 --- ConfigurationUtils.cs 10 Jan 2008 16:37:43 -0000 1.5 *************** *** 55,61 **** { #if !NET_2_0 ! return ConfigurationSettings.GetConfig(sectionName); #else ! return ConfigurationManager.GetSection(sectionName); #endif } --- 55,61 ---- { #if !NET_2_0 ! return ConfigurationSettings.GetConfig(sectionName.TrimEnd('/')); #else ! return ConfigurationManager.GetSection(sectionName.TrimEnd('/')); #endif } |
From: Bruno B. <bb...@us...> - 2008-01-10 14:32:33
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32003 Modified Files: AbstractObjectDefinitionReader.cs Log Message: Fixed exception message. Index: AbstractObjectDefinitionReader.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinitionReader.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AbstractObjectDefinitionReader.cs 8 Aug 2007 17:47:13 -0000 1.13 --- AbstractObjectDefinitionReader.cs 10 Jan 2008 14:32:24 -0000 1.14 *************** *** 228,232 **** } catch (Exception e) { ! throw new ObjectDefinitionStoreException("Could not resolve resource location location [" + location + "]",e); } int loadCount = LoadObjectDefinitions(resource); --- 228,232 ---- } catch (Exception e) { ! throw new ObjectDefinitionStoreException("Could not resolve resource location [" + location + "]",e); } int loadCount = LoadObjectDefinitions(resource); |
From: Mark P. <mar...@us...> - 2008-01-04 22:39:05
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.IocQuickStart.MovieFinder/src/MovieFinder In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14517/MovieFinder Modified Files: AppContext.xml Program.cs Added Files: AppContextContribution.xml Log Message: update MovieFinder example to show progammatic configuration of the container. Index: AppContext.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.IocQuickStart.MovieFinder/src/MovieFinder/AppContext.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AppContext.xml 30 Nov 2006 21:00:37 -0000 1.1 --- AppContext.xml 4 Jan 2008 22:38:58 -0000 1.2 *************** *** 5,21 **** <object id="MyMovieLister" type="Spring.IocQuickStart.MovieFinder.MovieLister, Spring.IocQuickStart.MovieFinder"> ! <property name="movieFinder" ref="MyMovieFinder"/> </object> <!-- - An IMovieFinder implementation that uses harcoded values as it's movie source... - --> <object id="MyMovieFinder" ! type="Spring.IocQuickStart.MovieFinder.SimpleMovieFinder, Spring.IocQuickStart.MovieFinder"/> ! <!-- ! An IMovieFinder implementation that uses a text file as it's movie source... --> <object id="AnotherMovieFinder" type="Spring.IocQuickStart.MovieFinder.ColonDelimitedMovieFinder, Spring.IocQuickStart.MovieFinder"> <constructor-arg index="0" value="movies.txt"/> </object> </objects> --- 5,25 ---- <object id="MyMovieLister" type="Spring.IocQuickStart.MovieFinder.MovieLister, Spring.IocQuickStart.MovieFinder"> ! <property name="movieFinder" ref="AnotherMovieFinder"/> </object> + + + <!-- An IMovieFinder implementation that uses harcoded values as it's movie source... --> <!-- <object id="MyMovieFinder" ! type="Spring.IocQuickStart.MovieFinder.SimpleMovieFinder, Spring.IocQuickStart.MovieFinder"/> --> + + + <!--An IMovieFinder implementation that uses a text file as it's movie source... --> + <object id="AnotherMovieFinder" type="Spring.IocQuickStart.MovieFinder.ColonDelimitedMovieFinder, Spring.IocQuickStart.MovieFinder"> <constructor-arg index="0" value="movies.txt"/> </object> + </objects> Index: Program.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.IocQuickStart.MovieFinder/src/MovieFinder/Program.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Program.cs 30 Nov 2006 21:00:39 -0000 1.1 --- Program.cs 4 Jan 2008 22:38:58 -0000 1.2 *************** *** 22,29 **** using System; ! using Common.Logging; using Spring.Context; using Spring.Context.Support; #endregion --- 22,33 ---- using System; ! using System.Collections.Specialized; using Common.Logging; + using Common.Logging.Log4Net; using Spring.Context; using Spring.Context.Support; + using Spring.Objects.Factory.Config; + using Spring.Objects.Factory.Support; + using Spring.Objects.Factory.Xml; #endregion *************** *** 56,64 **** try { ! // Retrieve context defined in the spring/context section of ! // the standard .NET configuration file. ! IApplicationContext ctx = ContextRegistry.GetContext(); ! MovieLister lister = (MovieLister) ctx.GetObject("MyMovieLister"); Movie[] movies = lister.MoviesDirectedBy("Roberto Benigni"); LOG.Debug("Searching for movie..."); --- 60,70 ---- try { ! IApplicationContext ctx = ! CreateContextMixXmlAndProgrammatic(); ! //CreateContextProgrammatically(); ! //CreateContextFromAppConfig(); ! //CreateContextProgrammaticallyWithAutoWire(); ! MovieLister lister = (MovieLister) ctx.GetObject("MyMovieLister"); Movie[] movies = lister.MoviesDirectedBy("Roberto Benigni"); LOG.Debug("Searching for movie..."); *************** *** 82,85 **** --- 88,178 ---- } } + + private static IApplicationContext CreateContextFromAppConfig() + { + // Retrieve context defined in the spring/context section of + // the standard .NET configuration file. + return ContextRegistry.GetContext(); + } + + private static IApplicationContext CreateContextProgrammatically() + { + InitializeCommonLogging(); + GenericApplicationContext ctx = new GenericApplicationContext(); + + IObjectDefinitionFactory objectDefinitionFactory = new DefaultObjectDefinitionFactory(); + + + //Create MovieLister and dependency on + ObjectDefinitionBuilder builder = + ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(MovieLister)); + builder.AddPropertyReference("MovieFinder", "AnotherMovieFinder"); + + ctx.RegisterObjectDefinition("MyMovieLister", builder.ObjectDefinition); + + builder = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(ColonDelimitedMovieFinder)); + builder.AddConstructorArg("movies.txt"); + ctx.RegisterObjectDefinition("AnotherMovieFinder", builder.ObjectDefinition); + + ctx.Refresh(); + + return ctx; + + } + + private static IApplicationContext CreateContextProgrammaticallyWithAutoWire() + { + InitializeCommonLogging(); + GenericApplicationContext ctx = new GenericApplicationContext(); + + IObjectDefinitionFactory objectDefinitionFactory = new DefaultObjectDefinitionFactory(); + + + //Create MovieLister and dependency on + ObjectDefinitionBuilder builder = + ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(MovieLister)); + builder.AddPropertyReference("MovieFinder", "BogusNameOfDependency") + .SetAutowireMode(AutoWiringMode.ByType); + + ctx.RegisterObjectDefinition("MyMovieLister", builder.ObjectDefinition); + + builder = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(ColonDelimitedMovieFinder)); + builder.AddConstructorArg("movies.txt") + .SetAutowireMode(AutoWiringMode.ByType); + + ctx.RegisterObjectDefinition("AnotherMovieFinder", builder.ObjectDefinition); + + ctx.Refresh(); + + return ctx; + + } + + private static IApplicationContext CreateContextMixXmlAndProgrammatic() + { + + GenericApplicationContext ctx = new GenericApplicationContext(); + + IObjectDefinitionReader objectDefinitionReader = new XmlObjectDefinitionReader(ctx); + objectDefinitionReader.LoadObjectDefinitions("assembly://Spring.IocQuickStart.MovieFinder/Spring.IocQuickStart.MovieFinder/AppContextContribution.xml"); + + IObjectDefinitionFactory objectDefinitionFactory = new DefaultObjectDefinitionFactory(); + ObjectDefinitionBuilder builder = + ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(ColonDelimitedMovieFinder)); + builder.AddConstructorArg("movies.txt"); + ctx.RegisterObjectDefinition("AnotherMovieFinder", builder.ObjectDefinition); + + + ctx.Refresh(); + + return ctx; + } + + private static void InitializeCommonLogging() + { + NameValueCollection properties = new NameValueCollection(); + properties["configType"] = "INLINE"; + LogManager.Adapter = new Log4NetLoggerFactoryAdapter(properties); + } } } \ No newline at end of file --- NEW FILE: AppContextContribution.xml --- <?xml version="1.0" encoding="utf-8" ?> <objects xmlns="http://www.springframework.net" > <description>An example that demonstrates contributing on implementation of MovieFinder progammatically.</description> <object id="MyMovieLister" type="Spring.IocQuickStart.MovieFinder.MovieLister, Spring.IocQuickStart.MovieFinder"> <property name="movieFinder" ref="AnotherMovieFinder"/> </object> </objects> |
From: Mark P. <mar...@us...> - 2008-01-04 22:39:05
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.IocQuickStart.MovieFinder/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14517 Modified Files: Spring.IocQuickStart.MovieFinder.2005.csproj Log Message: update MovieFinder example to show progammatic configuration of the container. Index: Spring.IocQuickStart.MovieFinder.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.IocQuickStart.MovieFinder/src/Spring.IocQuickStart.MovieFinder.2005.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.IocQuickStart.MovieFinder.2005.csproj 30 Nov 2006 21:00:37 -0000 1.1 --- Spring.IocQuickStart.MovieFinder.2005.csproj 4 Jan 2008 22:38:58 -0000 1.2 *************** *** 99,102 **** --- 99,103 ---- <ItemGroup> <EmbeddedResource Include="MovieFinder\AppContext.xml" /> + <EmbeddedResource Include="MovieFinder\AppContextContribution.xml" /> <Content Include="MovieFinder\movies.txt" /> </ItemGroup> |
From: Mark P. <mar...@us...> - 2008-01-04 19:49:03
|
Update of /cvsroot/springnet/Spring.Net In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14716 Modified Files: BreakingChanges-1.1.txt Log Message: added entry regarding moving of SlidingExpiration property from attribute to AspNetCache class Index: BreakingChanges-1.1.txt =================================================================== RCS file: /cvsroot/springnet/Spring.Net/BreakingChanges-1.1.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** BreakingChanges-1.1.txt 8 Dec 2007 00:02:02 -0000 1.18 --- BreakingChanges-1.1.txt 4 Jan 2008 19:48:59 -0000 1.19 *************** *** 114,117 **** --- 114,118 ---- 7. Moved Spring.Web.Validation to Spring.Web.UI.Validation 8. Moved Spring.Web.Process.AbstractProcess to Spring.Web.Support.AbstractProcessHandler + 9. Added SlidingExpiration property to AspNetCache object and removed from BaseCacheAttribute Spring.Data |
From: Mark P. <mar...@us...> - 2008-01-04 17:09:54
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4348 Modified Files: web.xml Log Message: SPRNET-814 - Improve Spring.Web DataBinding error handling ("SetErrorMessage()") documentation Index: web.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/web.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** web.xml 20 Dec 2007 16:33:52 -0000 1.32 --- web.xml 4 Jan 2008 17:09:51 -0000 1.33 *************** *** 1413,1428 **** <sect3> ! <title>HttpRequestListBindingContainer</title> ! <para> ! HttpRequestListBindingContainer extracts posted raw values from the request and populates the specified IList by creating objects ! of the type specified and populating each of these objects according to the requestBindings collection. ! </para> ! <para> ! Please checkout the WebQuickStart sample's demo of HttpRequestListBindingContainer. Below </para> <para><programlisting>protected override void InitializeDataBindings() { ! // HttpRequestListBindingContainer unbinds specified values from Request -> Productlist HttpRequestListBindingContainer requestBindings = new HttpRequestListBindingContainer("sku,name,quantity,price", "Products", typeof(ProductInfo)); --- 1413,1461 ---- <sect3> ! <title>Rendering Binding Errors</title> ! <para>If there are errors in the databinding, for example, trying to ! bind a string 'hello' to an integer property on the model, you can ! specify how those fundamental binding errors should be rendered. An ! example of this shown below taken from the WebQuickStart ! 'RobustEmployeeInfo' example. </para> ! ! <programlisting>[Default.aspx.cs] ! ! protected override void InitializeDataBindings() ! { ! // collect txtId.Text binding errors in "id.errors" collection ! BindingManager.AddBinding("txtId.Text", "Employee.Id").SetErrorMessage("ID has to be an integer", "id.errors"); ! ... ! ! [Default.aspx] ! ... ! <asp:TextBox ID="txtId" runat="server" /> ! <!-- output validation errors from "id.errors" collection --> ! <spring:ValidationError Provider="id.errors" runat="server" /> ! ...</programlisting> ! ! <para>The SetErrorMessage specifies the message text or resource id of ! the error message to be displayed followed by a variable length list ! of strings that specify the collection of error providers message ! where the message should be displayed. In the above case the error ! provider will be rendered in Spring's ValidationError User Control. </para> + </sect3> + + <sect3> + <title>HttpRequestListBindingContainer</title> + + <para>HttpRequestListBindingContainer extracts posted raw values from + the request and populates the specified IList by creating objects of + the type specified and populating each of these objects according to + the requestBindings collection.</para> + + <para>Please checkout the WebQuickStart sample's demo of + HttpRequestListBindingContainer. Below</para> + <para><programlisting>protected override void InitializeDataBindings() { ! // HttpRequestListBindingContainer unbinds specified values from Request -> Productlist HttpRequestListBindingContainer requestBindings = new HttpRequestListBindingContainer("sku,name,quantity,price", "Products", typeof(ProductInfo)); *************** *** 1434,1439 **** BindingManager.AddBinding(requestBindings); }</programlisting></para> ! <note>Due to the fact, that browsers don't send the values of unchecked checkboxes, you can't use HttpRequestListBindingContainer ! with <input type="checkbox" > html controls.</note> </sect3> </sect2> --- 1467,1474 ---- BindingManager.AddBinding(requestBindings); }</programlisting></para> ! ! <note> ! Due to the fact, that browsers don't send the values of unchecked checkboxes, you can't use HttpRequestListBindingContainer with <input type="checkbox" > html controls. ! </note> </sect3> </sect2> *************** *** 1518,1522 **** <note> ! The Visual Studio Web Form Editor will of course complain about binding attributes because it doesn't know them. You can safely ignore those warnings. </note> </sect2> --- 1553,1557 ---- <note> ! The Visual Studio Web Form Editor will of course complain about binding attributes because it doesn't know them. You can safely ignore those warnings. </note> </sect2> |
From: Mark P. <mar...@us...> - 2008-01-02 19:58:19
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7562 Modified Files: TypedDataSetUtils.cs Log Message: SPRNET-835 - Add additional convenience method to set TableAdapter transaction/connection properties using DbProvider. SPRNET-827 - TypedDataSetUtils should use IDbCommand instead of provider specified SqlDbCommand. Index: TypedDataSetUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Support/TypedDataSetUtils.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypedDataSetUtils.cs 13 Nov 2006 07:04:47 -0000 1.2 --- TypedDataSetUtils.cs 2 Jan 2008 19:58:14 -0000 1.3 *************** *** 22,28 **** using System.Data; - using System.Data.SqlClient; using System.Reflection; using Common.Logging; namespace Spring.Data.Support --- 22,28 ---- using System.Data; using System.Reflection; using Common.Logging; + using Spring.Data.Common; namespace Spring.Data.Support *************** *** 64,71 **** --- 64,86 ---- /// /// </remarks> + /// <version>$Id:</version> public abstract class TypedDataSetUtils { private static readonly ILog LOG = LogManager.GetLogger(typeof (TypedDataSetUtils)); + + /// <summary> + /// Applies the connection and tx to the provided typed dataset. The connection and transaction + /// used are taken from the Spring's current transactional context. See ConnectionUtils.GetConnectionTxPair + /// for more information + /// </summary> + /// <param name="typedDataSetAdapter">The typed data set adapter.</param> + /// <param name="dbProvider">The db provider.</param> + public static void ApplyConnectionAndTx(object typedDataSetAdapter, IDbProvider dbProvider) + { + ConnectionTxPair connectionTxPairToUse = ConnectionUtils.GetConnectionTxPair(dbProvider); + ApplyConnectionAndTxToDataAdapter(typedDataSetAdapter, connectionTxPairToUse.Connection, connectionTxPairToUse.Transaction); + } + /// <summary> /// Applies the connection and tx to the provided typed dataset. *************** *** 77,99 **** /// the connection/transaction of the current Spring transaction scope.</param> public static void ApplyConnectionAndTx(object typedDataSetAdapter, IDbCommand sourceCommand) { - //TODO check that the connection in the typedDataSet isn't already open, if it is throw - //a DAO exception. - - //TODO better error checking/exceptions thrown for reflective code. - IDbDataAdapter dataAdapter = GetDataAdapter(typedDataSetAdapter); if (dataAdapter != null) { ! ApplyConnectionAndTxToCommand(dataAdapter.SelectCommand, sourceCommand); ! ApplyConnectionAndTxToCommand(dataAdapter.InsertCommand, sourceCommand); ! ApplyConnectionAndTxToCommand(dataAdapter.UpdateCommand, sourceCommand); ! ApplyConnectionAndTxToCommand(dataAdapter.DeleteCommand, sourceCommand); } else --- 92,135 ---- /// the connection/transaction of the current Spring transaction scope.</param> public static void ApplyConnectionAndTx(object typedDataSetAdapter, IDbCommand sourceCommand) + { + if (sourceCommand != null) + { + ApplyConnectionAndTxToDataAdapter(typedDataSetAdapter, sourceCommand.Connection, sourceCommand.Transaction); + } + } + + private static IDbCommand[] GetCommandCollection(object typedDataSetAdapter) + { + PropertyInfo pi = + typedDataSetAdapter.GetType().GetProperty("CommandCollection", + BindingFlags.NonPublic | BindingFlags.Instance); + MethodInfo mi = pi.GetGetMethod(true); + return mi.Invoke(typedDataSetAdapter, null) as IDbCommand[]; + } + + private static IDbDataAdapter GetDataAdapter(object typedDataSetAdapter) + { + PropertyInfo api = + typedDataSetAdapter.GetType().GetProperty("Adapter", + BindingFlags.NonPublic | BindingFlags.Instance); + MethodInfo ami = api.GetGetMethod(true); + return ami.Invoke(typedDataSetAdapter, null) as IDbDataAdapter; + } + + private static void ApplyConnectionAndTxToDataAdapter(object typedDataSetAdapter, IDbConnection connection, IDbTransaction transaction) { IDbDataAdapter dataAdapter = GetDataAdapter(typedDataSetAdapter); if (dataAdapter != null) { ! ApplyConnectionAndTxToCommand(dataAdapter.SelectCommand, connection, transaction); ! ApplyConnectionAndTxToCommand(dataAdapter.InsertCommand, connection, transaction); ! ApplyConnectionAndTxToCommand(dataAdapter.UpdateCommand, connection, transaction); ! ApplyConnectionAndTxToCommand(dataAdapter.DeleteCommand, connection, transaction); } else *************** *** 102,106 **** } ! IDbCommand[] commandCollection = GetCommandCollection(typedDataSetAdapter); if (commandCollection != null) --- 138,142 ---- } ! IDbCommand[] commandCollection = GetCommandCollection(typedDataSetAdapter); if (commandCollection != null) *************** *** 109,114 **** foreach (IDbCommand dbCommand in commandCollection) { ! dbCommand.Connection = sourceCommand.Connection; ! dbCommand.Transaction = sourceCommand.Transaction; } } --- 145,150 ---- foreach (IDbCommand dbCommand in commandCollection) { ! dbCommand.Connection = connection; ! dbCommand.Transaction = transaction; } } *************** *** 119,148 **** } - private static IDbCommand[] GetCommandCollection(object typedDataSetAdapter) - { - PropertyInfo pi = - typedDataSetAdapter.GetType().GetProperty("CommandCollection", - BindingFlags.NonPublic | BindingFlags.Instance); - MethodInfo mi = pi.GetGetMethod(true); - return mi.Invoke(typedDataSetAdapter, null) as SqlCommand[]; - } ! private static IDbDataAdapter GetDataAdapter(object typedDataSetAdapter) ! { ! PropertyInfo api = ! typedDataSetAdapter.GetType().GetProperty("Adapter", ! BindingFlags.NonPublic | BindingFlags.Instance); ! MethodInfo ami = api.GetGetMethod(true); ! return ami.Invoke(typedDataSetAdapter, null) as IDbDataAdapter; ! } ! ! private static void ApplyConnectionAndTxToCommand(IDbCommand targetDbCommand, IDbCommand sourceCommand) { if (targetDbCommand != null) { ! targetDbCommand.Connection = sourceCommand.Connection; ! targetDbCommand.Transaction = sourceCommand.Transaction; } } } } --- 155,169 ---- } ! private static void ApplyConnectionAndTxToCommand(IDbCommand targetDbCommand, IDbConnection connection, IDbTransaction transaction) { if (targetDbCommand != null) { ! targetDbCommand.Connection = connection; ! targetDbCommand.Transaction = transaction; } } + + } } |
From: Mark P. <mar...@us...> - 2007-12-30 01:55:22
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26119 Modified Files: MatchAlwaysTransactionAttributeSourceTests.cs Log Message: omit partially written test... Index: MatchAlwaysTransactionAttributeSourceTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor/MatchAlwaysTransactionAttributeSourceTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MatchAlwaysTransactionAttributeSourceTests.cs 29 Dec 2007 00:28:59 -0000 1.5 --- MatchAlwaysTransactionAttributeSourceTests.cs 30 Dec 2007 01:55:19 -0000 1.6 *************** *** 32,36 **** } ! [Test] public void MethodMapTransactionAttributeSource() { --- 32,36 ---- } ! [Test, Ignore] public void MethodMapTransactionAttributeSource() { *************** *** 48,52 **** ! [Test, Explicit] public void CanConfigureInAppContext() { --- 48,52 ---- ! [Test] public void CanConfigureInAppContext() { |
From: Mark P. <mar...@us...> - 2007-12-29 01:16:10
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1944 Modified Files: DefaultTransactionAttributeTests.cs Log Message: make ToString() in DefaultTransactionAttribute more accurate. Index: DefaultTransactionAttributeTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor/DefaultTransactionAttributeTests.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DefaultTransactionAttributeTests.cs 7 Dec 2007 07:31:10 -0000 1.4 --- DefaultTransactionAttributeTests.cs 29 Dec 2007 01:16:07 -0000 1.5 *************** *** 19,23 **** { DefaultTransactionAttribute dta = new DefaultTransactionAttribute(); ! Assert.AreEqual( "PROPAGATION_Required,ISOLATION_ReadCommitted,-SystemException", dta.ToString()); } } --- 19,23 ---- { DefaultTransactionAttribute dta = new DefaultTransactionAttribute(); ! Assert.AreEqual( "PROPAGATION_Required,ISOLATION_ReadCommitted,-System.Exception", dta.ToString()); } } |
From: Mark P. <mar...@us...> - 2007-12-29 00:31:04
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18183 Modified Files: ObjectUtils.cs Log Message: performance improvements in ado.net framework, optimize reflection calls. Index: ObjectUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util/ObjectUtils.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ObjectUtils.cs 28 Dec 2007 22:40:41 -0000 1.8 --- ObjectUtils.cs 29 Dec 2007 00:31:00 -0000 1.9 *************** *** 154,157 **** --- 154,162 ---- } + /// <summary> + /// Determines whether the specified type is instantiable, i.e. not an interface, abstract class or contains + /// open generic type parameters. + /// </summary> + /// <param name="type">The type.</param> public static void IsInstantiable(Type type) { |
From: Mark P. <mar...@us...> - 2007-12-29 00:29:03
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17333 Modified Files: MatchAlwaysTransactionAttributeSourceTests.cs MatchAlwaysTransactionAttributeSourceTests.xml Log Message: SPRNET-818 - Provide .NET TypeConverter for ITransactionAttribute Added Equals,HashCode,ToString to MethodMapTransactionAttributeSource Index: MatchAlwaysTransactionAttributeSourceTests.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor/MatchAlwaysTransactionAttributeSourceTests.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MatchAlwaysTransactionAttributeSourceTests.xml 13 Dec 2007 21:18:36 -0000 1.1 --- MatchAlwaysTransactionAttributeSourceTests.xml 29 Dec 2007 00:28:59 -0000 1.2 *************** *** 3,14 **** <object id="MatchAlwaysTransactionAttributeSource" type="Spring.Transaction.Interceptor.MatchAlwaysTransactionAttributeSource, Spring.Data"> ! <property name="transactionAttribute" value="PROPAGATION_REQUIRESNEW" /> ! <!-- ! <property name="transactionAttribute"> ! <object type="Spring.Transaction.Interceptor.DefaultTransactionAttribute"> ! <property name="PropagationBehavior" value="RequiresNew" /> ! </object> ! </property> ! --> </object> </objects> --- 3,9 ---- <object id="MatchAlwaysTransactionAttributeSource" type="Spring.Transaction.Interceptor.MatchAlwaysTransactionAttributeSource, Spring.Data"> ! ! <property name="transactionAttribute" value="PROPAGATION_REQUIRES_NEW" /> ! </object> </objects> Index: MatchAlwaysTransactionAttributeSourceTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor/MatchAlwaysTransactionAttributeSourceTests.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MatchAlwaysTransactionAttributeSourceTests.cs 13 Dec 2007 21:18:36 -0000 1.4 --- MatchAlwaysTransactionAttributeSourceTests.cs 29 Dec 2007 00:28:59 -0000 1.5 *************** *** 1,38 **** using System; using System.Data; using NUnit.Framework; using Spring.Context; using Spring.Context.Support; namespace Spring.Transaction.Interceptor { ! /// <summary> ! /// Test MatchAlwaysTransactionAttributeSourceTests ! /// </summary> ! /// <author>Mark Pollack</author> ! /// <version>$Id$</version> ! [TestFixture] ! public class MatchAlwaysTransactionAttributeSourceTests ! { ! [Test] ! public void GetTransactionAttribute() { ! MatchAlwaysTransactionAttributeSource tas = new MatchAlwaysTransactionAttributeSource(); ! ITransactionAttribute ta = tas.ReturnTransactionAttribute(typeof(Object).GetMethod("GetHashCode"), null); ! Assert.IsNotNull(ta); ! Assert.IsTrue(TransactionPropagation.Required == ta.PropagationBehavior); ! tas.TransactionAttribute = new DefaultTransactionAttribute(TransactionPropagation.Supports); ! ta = tas.ReturnTransactionAttribute(typeof(DataException).GetType().GetMethod("GetHashCode"), typeof(DataException)); ! Assert.IsNotNull(ta); ! Assert.IsTrue(TransactionPropagation.Supports == ta.PropagationBehavior); ! } ! [Test, Explicit] ! public void CanConfigureInAppContext() ! { ! IApplicationContext ctx = new XmlApplicationContext("assembly://Spring.Data.Tests/Spring.Transaction.Interceptor/MatchAlwaysTransactionAttributeSourceTests.xml"); ! MatchAlwaysTransactionAttributeSource tas = (MatchAlwaysTransactionAttributeSource) ctx.GetObject("MatchAlwaysTransactionAttributeSource"); ! Assert.AreEqual( TransactionPropagation.RequiresNew, tas.ReturnTransactionAttribute(null, null).PropagationBehavior ); } ! } ! } --- 1,63 ---- using System; + using System.Collections; using System.Data; using NUnit.Framework; using Spring.Context; using Spring.Context.Support; + using Spring.Core.TypeResolution; namespace Spring.Transaction.Interceptor { ! /// <summary> ! /// Test MatchAlwaysTransactionAttributeSourceTests ! /// </summary> ! /// <author>Mark Pollack</author> ! /// <version>$Id$</version> ! [TestFixture] ! public class MatchAlwaysTransactionAttributeSourceTests { ! [Test] ! public void GetTransactionAttribute() ! { ! MatchAlwaysTransactionAttributeSource tas = new MatchAlwaysTransactionAttributeSource(); ! ITransactionAttribute ta = tas.ReturnTransactionAttribute(typeof (Object).GetMethod("GetHashCode"), null); ! Assert.IsNotNull(ta); ! Assert.IsTrue(TransactionPropagation.Required == ta.PropagationBehavior); ! tas.TransactionAttribute = new DefaultTransactionAttribute(TransactionPropagation.Supports); ! ta = ! tas.ReturnTransactionAttribute(typeof (DataException).GetType().GetMethod("GetHashCode"), ! typeof (DataException)); ! Assert.IsNotNull(ta); ! Assert.IsTrue(TransactionPropagation.Supports == ta.PropagationBehavior); ! } ! [Test] ! public void MethodMapTransactionAttributeSource() ! { ! TypeRegistry.RegisterType("TransactionPropagation", typeof(TransactionPropagation)); ! ! MethodMapTransactionAttributeSource tas = new MethodMapTransactionAttributeSource(); ! IDictionary methodMap = new Hashtable(); ! methodMap.Add(typeof(Object).GetType().Name + ".GetHashCode", "PROPAGATION_REQUIRED"); ! methodMap.Add(typeof (Object).GetType().Name + ".ToString", ! new DefaultTransactionAttribute(TransactionPropagation.RequiresNew)); ! tas.MethodMap = methodMap; ! ! ! } ! ! ! [Test, Explicit] ! public void CanConfigureInAppContext() ! { ! TypeRegistry.RegisterType("TransactionPropagation", typeof(TransactionPropagation)); ! IApplicationContext ctx = ! new XmlApplicationContext( ! "assembly://Spring.Data.Tests/Spring.Transaction.Interceptor/MatchAlwaysTransactionAttributeSourceTests.xml"); ! MatchAlwaysTransactionAttributeSource tas = ! (MatchAlwaysTransactionAttributeSource) ctx.GetObject("MatchAlwaysTransactionAttributeSource"); ! Assert.AreEqual(TransactionPropagation.RequiresNew, ! tas.ReturnTransactionAttribute(null, null).PropagationBehavior); ! } } ! } \ No newline at end of file |
From: Mark P. <mar...@us...> - 2007-12-29 00:28:59
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17314 Modified Files: DefaultTransactionAttribute.cs ITransactionAttribute.cs MatchAlwaysTransactionAttributeSource.cs MethodMapTransactionAttributeSource.cs Added Files: TransactionAttributeConverter.cs Log Message: SPRNET-818 - Provide .NET TypeConverter for ITransactionAttribute Added Equals,HashCode,ToString to MethodMapTransactionAttributeSource Index: MethodMapTransactionAttributeSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/MethodMapTransactionAttributeSource.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MethodMapTransactionAttributeSource.cs 20 Sep 2007 12:31:01 -0000 1.11 --- MethodMapTransactionAttributeSource.cs 29 Dec 2007 00:28:53 -0000 1.12 *************** *** 26,29 **** --- 26,30 ---- using Common.Logging; + using Spring.Objects.Factory; using Spring.Util; using Spring.Core.TypeResolution; *************** *** 284,287 **** --- 285,290 ---- } #endregion + + } } Index: ITransactionAttribute.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/ITransactionAttribute.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ITransactionAttribute.cs 18 May 2006 21:37:51 -0000 1.5 --- ITransactionAttribute.cs 29 Dec 2007 00:28:53 -0000 1.6 *************** *** 20,23 **** --- 20,24 ---- using System; + using System.ComponentModel; namespace Spring.Transaction.Interceptor *************** *** 30,33 **** --- 31,35 ---- /// <author>Griffin Caprio (.NET)</author> /// <version>$Id$</version> + [TypeConverter(typeof(TransactionAttributeConverter))] public interface ITransactionAttribute : ITransactionDefinition { --- NEW FILE: TransactionAttributeConverter.cs --- #region License /* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #endregion using System; using System.ComponentModel; using System.Globalization; namespace Spring.Transaction.Interceptor { /// <summary> /// Type converter for <see cref="Spring.Transaction.Interceptor.ITransactionAttribute"/> /// objects. /// </summary> /// <remarks> /// Takes <see cref="System.String"/>s of the form /// <p><code>PROPAGATION_NAME,ISOLATION_NAME,readOnly,timeout_NNNN,+Exception1,-Exception2</code></p> /// <p>where only propagation code is required. For example:</p> /// <p><code>PROPAGATION_MANDATORY,ISOLATION_DEFAULT</code></p> /// <p> /// The tokens can be in <strong>any</strong> order. Propagation and isolation codes /// must use the names of the values in the <see cref="Spring.Transaction.TransactionPropagation"/> /// enumeration. Timeout values are in seconds. If no timeout is specified, the transaction /// manager will apply a default timeout specific to the particular transaction manager. /// </p> /// <p> /// A "+" before an exception name substring indicates that transactions should commit even /// if this exception is thrown; a "-" that they should roll back. /// </p> /// </remarks> /// <author>Mark Pollack</author> /// <version>$Id: TransactionAttributeConverter.cs,v 1.1 2007/12/29 00:28:53 markpollack Exp $</version> public class TransactionAttributeConverter : TypeConverter { /// <summary> /// Returns whether this converter can convert an object of the given type to an ITransactionAttribute, using the specified context. /// </summary> /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param> /// <param name="sourceType">A <see cref="T:System.Type"></see> that represents the type you want to convert from.</param> /// <returns> /// true if this converter can perform the conversion; otherwise, false. /// </returns> public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType) { if (sourceType == typeof (string)) { return true; } return base.CanConvertFrom(context, sourceType); } /// <summary> /// Converts from string to ITransactionAttribute /// </summary> /// <param name="context">The context.</param> /// <param name="culture">The culture.</param> /// <param name="val">The string value to convert</param> /// <returns>An ITransactionAttribute instance</returns> public override object ConvertFrom( ITypeDescriptorContext context, CultureInfo culture, object val) { if (val is string) { string value = val as string; TransactionAttributeEditor editor = new TransactionAttributeEditor(); editor.SetAsText(value); return editor.Value; } return base.ConvertFrom(context, culture, val); } } } Index: MatchAlwaysTransactionAttributeSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/MatchAlwaysTransactionAttributeSource.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MatchAlwaysTransactionAttributeSource.cs 18 May 2006 21:37:51 -0000 1.6 --- MatchAlwaysTransactionAttributeSource.cs 29 Dec 2007 00:28:53 -0000 1.7 *************** *** 83,86 **** --- 83,126 ---- } #endregion + + /// <summary> + /// Determines whether the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>. + /// </summary> + /// <param name="obj">The <see cref="T:System.Object"></see> to compare with the current <see cref="T:System.Object"></see>.</param> + /// <returns> + /// true if the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>; otherwise, false. + /// </returns> + public override bool Equals(object obj) + { + if (this == obj) return true; + MatchAlwaysTransactionAttributeSource matchAlwaysTransactionAttributeSource = obj as MatchAlwaysTransactionAttributeSource; + if (matchAlwaysTransactionAttributeSource == null) return false; + return Equals(_transactionAttribute, matchAlwaysTransactionAttributeSource._transactionAttribute); + } + + /// <summary> + /// Serves as a hash function for a particular type. <see cref="M:System.Object.GetHashCode"></see> is suitable for use in hashing algorithms and data structures like a hash table. + /// </summary> + /// <returns> + /// A hash code for the current <see cref="T:System.Object"></see>. + /// </returns> + public override int GetHashCode() + { + return _transactionAttribute != null ? _transactionAttribute.GetHashCode() : 0; + } + + + ///<summary> + ///Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>. + ///</summary> + /// + ///<returns> + ///A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>. + ///</returns> + ///<filterpriority>2</filterpriority> + public override string ToString() + { + return GetType().Name + ": " + _transactionAttribute; + } } } Index: DefaultTransactionAttribute.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/DefaultTransactionAttribute.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DefaultTransactionAttribute.cs 21 Oct 2007 18:16:38 -0000 1.8 --- DefaultTransactionAttribute.cs 29 Dec 2007 00:28:53 -0000 1.9 *************** *** 93,97 **** { string result = DefinitionDescription; ! result += "," + ROLLBACK_RULE_PREFIX + "SystemException"; return result; } --- 93,97 ---- { string result = DefinitionDescription; ! result += "," + ROLLBACK_RULE_PREFIX + "System.Exception"; return result; } |
From: Mark P. <mar...@us...> - 2007-12-28 22:40:44
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7757 Modified Files: ObjectUtils.cs Log Message: performance improvements in ado.net framework, optimize reflection calls. Index: ObjectUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util/ObjectUtils.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ObjectUtils.cs 5 Oct 2007 17:06:01 -0000 1.7 --- ObjectUtils.cs 28 Dec 2007 22:40:41 -0000 1.8 *************** *** 129,132 **** --- 129,159 ---- AssertUtils.ArgumentNotNull(type, "type"); + ConstructorInfo constructor = GetZeroArgConstructorInfo(type); + return ObjectUtils.InstantiateType(constructor, ObjectUtils.EmptyObjects); + } + + /// <summary> + /// Gets the zero arg ConstructorInfo object, if the type offers such functionality. + /// </summary> + /// <param name="type">The type.</param> + /// <returns>Zero argument ConstructorInfo</returns> + /// <exception cref="FatalReflectionException"> + /// If the type is an interface, abstract, open generic type, or does not have a zero-arg constructor. + /// </exception> + public static ConstructorInfo GetZeroArgConstructorInfo(Type type) + { + IsInstantiable(type); + ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); + if (constructor == null) + { + throw new FatalReflectionException( + string.Format( + CultureInfo.InvariantCulture, "Cannot instantiate a class that does not have a public no-argument constructor [{0}].", type)); + } + return constructor; + } + + public static void IsInstantiable(Type type) + { if (type.IsInterface) { *************** *** 149,160 **** } #endif - ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); - if (constructor == null) - { - throw new FatalReflectionException( - string.Format( - CultureInfo.InvariantCulture, "Cannot instantiate a class that does not have a public no-argument constructor [{0}].", type)); - } - return ObjectUtils.InstantiateType(constructor, ObjectUtils.EmptyObjects); } --- 176,179 ---- |
From: Mark P. <mar...@us...> - 2007-12-28 19:37:17
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31486/Common Modified Files: DbProvider.cs Log Message: performance improvements in ado.net framework, optimize reflection calls. Index: DbProvider.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/DbProvider.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DbProvider.cs 7 Dec 2007 08:09:52 -0000 1.14 --- DbProvider.cs 28 Dec 2007 19:37:13 -0000 1.15 *************** *** 22,25 **** --- 22,26 ---- using System.Data; using Spring.Expressions; + using Spring.Reflection.Dynamic; using Spring.Util; *************** *** 33,36 **** --- 34,42 ---- private string connectionString; private IDbMetadata dbMetadata; + private IDynamicConstructor newCommand; + private IDynamicConstructor newConnection; + private IDynamicConstructor newCommandBuilder; + private IDynamicConstructor newDataAdapter; + private IDynamicConstructor newParameter; /// <summary> *************** *** 41,44 **** --- 47,55 ---- { this.dbMetadata = dbMetadata; + newCommand = DynamicConstructor.Create(dbMetadata.CommandType.GetConstructor(Type.EmptyTypes)); + newConnection = DynamicConstructor.Create(dbMetadata.ConnectionType.GetConstructor(Type.EmptyTypes)); + newCommandBuilder = DynamicConstructor.Create(dbMetadata.CommandBuilderType.GetConstructor(Type.EmptyTypes)); + newDataAdapter = DynamicConstructor.Create(dbMetadata.DataAdapterType.GetConstructor(Type.EmptyTypes)); + newParameter = DynamicConstructor.Create(dbMetadata.ParameterType.GetConstructor(Type.EmptyTypes)); } *************** *** 50,54 **** public IDbCommand CreateCommand() { ! return ObjectUtils.InstantiateType(dbMetadata.CommandType) as IDbCommand; } --- 61,65 ---- public IDbCommand CreateCommand() { ! return newCommand.Invoke(ObjectUtils.EmptyObjects) as IDbCommand; } *************** *** 62,66 **** public object CreateCommandBuilder() { ! return ObjectUtils.InstantiateType(dbMetadata.CommandBuilderType); } --- 73,77 ---- public object CreateCommandBuilder() { ! return newCommandBuilder.Invoke(ObjectUtils.EmptyObjects); } *************** *** 71,77 **** public IDbConnection CreateConnection() { ! //TODO see if connection supports ICloneable and use it. ! //TODO use .NET 2.0 factory class if on 2.0 ! IDbConnection conn = ObjectUtils.InstantiateType(dbMetadata.ConnectionType) as IDbConnection; if (conn != null) { --- 82,86 ---- public IDbConnection CreateConnection() { ! IDbConnection conn = newConnection.Invoke(ObjectUtils.EmptyObjects) as IDbConnection; if (conn != null) { *************** *** 87,91 **** public IDbDataAdapter CreateDataAdapter() { ! return ObjectUtils.InstantiateType(dbMetadata.DataAdapterType) as IDbDataAdapter; } --- 96,100 ---- public IDbDataAdapter CreateDataAdapter() { ! return newDataAdapter.Invoke(ObjectUtils.EmptyObjects) as IDbDataAdapter; } *************** *** 97,101 **** public IDbDataParameter CreateParameter() { ! return ObjectUtils.InstantiateType(dbMetadata.ParameterType) as IDbDataParameter; } --- 106,110 ---- public IDbDataParameter CreateParameter() { ! return newParameter.Invoke(ObjectUtils.EmptyObjects) as IDbDataParameter; } |