You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael D. <mik...@us...> - 2004-05-18 04:59:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/DriverTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26443/DriverTest Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/DriverTest added to the repository |
From: Michael D. <mik...@us...> - 2004-05-16 21:17:56
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543 Added Files: releasenotes.txt Log Message: Release Notes file added to cvs. --- NEW FILE: releasenotes.txt --- PreAlpha BUild 3 ======================== Synched Cache Namespace with cache package in H2.0.3 Synched CollectionPersister with H2.0.3 Synched Config Namespace with config package in H2.0.3. Synched Cascade strategies with H2.0.3 Synched Dialect Namespace with dialect package in H2.0.3 Started HQL Namespace synch with hql package in H2.0.3. There are still some issues in there. Synched Id Namespace with id package in H2.0.3 Synched Mapping namespace with mapping package in H2.0.3. Added ForUpdateFragment hbm2net created. Added AnsiStringType. Added GuidType. Fixed problem with IdentityMap that caused <set lazy="true"> to not work. Added support for <bag> and <id-bag> mappings. Implemented sorted collections. Build files rewritten. MsSql Dialect now issues one statement to Insert and retrieve identity value. Fixed a bug with <generator class="sequence"> Implemented SqlExpression for Criteria queries. Initial fix of Multiple IDataReaders being opened with Entities that contain <component> mappings. Fixed problems with Alias and Ms Sql Server. |
From: Michael D. <mik...@us...> - 2004-05-16 21:11:29
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28266 Modified Files: NHibernateSolution.build Log Message: fixed up for build 3. Index: NHibernateSolution.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/NHibernateSolution.build,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHibernateSolution.build 14 May 2004 12:08:54 -0000 1.1 --- NHibernateSolution.build 16 May 2004 21:11:20 -0000 1.2 *************** *** 21,25 **** <property name="project.config" value="debug" /> <property name="build.debug" value="true" /> ! <property name="build.dir" value="${nant.project.basedir}/build/${project.name}-${project.version}-${project.config}" /> </target> --- 21,26 ---- <property name="project.config" value="debug" /> <property name="build.debug" value="true" /> ! <property name="build.name" value="${project.name}-${project.version}-${project.config}" /> ! <property name="build.dir" value="${nant.project.basedir}/build/${build.name}" /> </target> *************** *** 27,31 **** <property name="project.config" value="release" /> <property name="build.debug" value="false" /> ! <property name="build.dir" value="${nant.project.basedir}/build/${project.name}-${project.version}" /> </target> --- 28,33 ---- <property name="project.config" value="release" /> <property name="build.debug" value="false" /> ! <property name="build.name" value="${project.name}-${project.version}" /> ! <property name="build.dir" value="${nant.project.basedir}/build/${build.name}" /> </target> *************** *** 80,83 **** --- 82,88 ---- <target name="test" depends="build" description="Runs the tests contained in NHibernate.Test" > + <!-- make sure the config file is NOT readonly --> + <attrib file="${build.dir}/bin/NHibernate.Test.dll.config" readonly="false" /> + <!-- Tell nhibernate how to connect to the test database. *************** *** 229,237 **** <copy todir="${build.dir}"> <fileset> <!-- exclude the UnitTesting project that is no longer used --> <excludes name="src/UnitTesting/**" /> - <includes name="src/**" /> <!-- exclude VS.NET stuff --> <excludes name="**/*.suo" /> --- 234,248 ---- <copy todir="${build.dir}"> <fileset> + <includes name="external-bin/**" /> + <!-- exclude the UnitTesting project that is no longer used --> <excludes name="src/UnitTesting/**" /> <includes name="src/**" /> + <includes name="NHibernateSolution.build" /> + <includes name="lpgl.txt" /> + <includes name="releasenotes.txt" /> + <includes name="readme.html" /> + <!-- exclude VS.NET stuff --> <excludes name="**/*.suo" /> *************** *** 242,246 **** </fileset> </copy> ! <property name="project.zip-path" value="${nant.project.basedir}/build/${project.name}-${project.version}.zip" /> <zip zipfile="${project.zip-path}"> --- 253,257 ---- </fileset> </copy> ! <property name="project.zip-path" value="${nant.project.basedir}/build/${build.name}.zip" /> <zip zipfile="${project.zip-path}"> *************** *** 250,254 **** </zip> ! <echo message="Create a '${project.config}' package ast file://${project.zip-path}" /> </target> --- 261,265 ---- </zip> ! <echo message="Create a '${project.config}' package as file://${project.zip-path}" /> </target> |
From: Michael D. <mik...@us...> - 2004-05-16 04:03:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22842/NHibernate Modified Files: AssemblyInfo.cs Log Message: Incrementing version for prealpha build 3. Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/AssemblyInfo.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AssemblyInfo.cs 22 Apr 2004 11:52:54 -0000 1.3 --- AssemblyInfo.cs 16 May 2004 04:02:41 -0000 1.4 *************** *** 21,30 **** // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: ! [assembly: AssemblyVersionAttribute("0.0.5000.2")] [assembly: AssemblyInformationalVersionAttribute("0.0")] ! [assembly: AssemblyFileVersionAttribute("0.0000.2")] [assembly: AssemblyDelaySignAttribute(false)] ! [assembly: AssemblyKeyFile("..\\..\\NHibernate.snk")] --- 21,30 ---- // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: ! [assembly: AssemblyVersionAttribute("0.0.5000.3")] [assembly: AssemblyInformationalVersionAttribute("0.0")] ! [assembly: AssemblyFileVersionAttribute("0.0000.3")] [assembly: AssemblyDelaySignAttribute(false)] ! //[assembly: AssemblyKeyFile("..\\..\\NHibernate.snk")] |
From: Michael D. <mik...@us...> - 2004-05-16 04:02:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22842/NHibernate.Test Modified Files: AssemblyInfo.cs Log Message: Incrementing version for prealpha build 3. Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssemblyInfo.cs 31 Mar 2004 18:53:02 -0000 1.2 --- AssemblyInfo.cs 16 May 2004 04:02:42 -0000 1.3 *************** *** 21,27 **** // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: ! [assembly: AssemblyVersionAttribute("0.0.5000.2")] [assembly: AssemblyInformationalVersionAttribute("0.0")] ! [assembly: AssemblyFileVersionAttribute("0.0000.2")] [assembly: AssemblyDelaySignAttribute(false)] \ No newline at end of file --- 21,27 ---- // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: ! [assembly: AssemblyVersionAttribute("0.0.5000.3")] [assembly: AssemblyInformationalVersionAttribute("0.0")] ! [assembly: AssemblyFileVersionAttribute("0.0000.3")] [assembly: AssemblyDelaySignAttribute(false)] \ No newline at end of file |
From: Michael D. <mik...@us...> - 2004-05-16 04:02:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22842/NHibernate.DomainModel Modified Files: AssemblyInfo.cs Log Message: Incrementing version for prealpha build 3. Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssemblyInfo.cs 31 Mar 2004 18:53:01 -0000 1.2 --- AssemblyInfo.cs 16 May 2004 04:02:41 -0000 1.3 *************** *** 21,27 **** // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: ! [assembly: AssemblyVersionAttribute("0.0.5000.2")] [assembly: AssemblyInformationalVersionAttribute("0.0")] ! [assembly: AssemblyFileVersionAttribute("0.0000.2")] [assembly: AssemblyDelaySignAttribute(false)] --- 21,27 ---- // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: ! [assembly: AssemblyVersionAttribute("0.0.5000.3")] [assembly: AssemblyInformationalVersionAttribute("0.0")] ! [assembly: AssemblyFileVersionAttribute("0.0000.3")] [assembly: AssemblyDelaySignAttribute(false)] |
From: Michael D. <mik...@us...> - 2004-05-16 03:53:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21191/NHibernate/Impl Modified Files: SessionFactoryImpl.cs Log Message: Fixed another Cache reference for Collections. Not sure that I like the property name for the Cache to be different between persitent Collections (CacheConcurrenctyStrategy) and persistent Clasess (Cache). There is a method in Collections.Cache() and that causes compile conflicts. Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** SessionFactoryImpl.cs 13 May 2004 13:45:16 -0000 1.17 --- SessionFactoryImpl.cs 16 May 2004 03:53:26 -0000 1.18 *************** *** 651,655 **** foreach(CollectionPersister p in collectionPersisters.Values) { ! if ( p.HasCache ) p.Cache.Destroy(); } --- 651,655 ---- foreach(CollectionPersister p in collectionPersisters.Values) { ! if ( p.HasCache ) p.CacheConcurrencyStrategy.Destroy(); } |
From: Michael D. <mik...@us...> - 2004-05-16 03:49:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20559/NHibernate.Test Modified Files: SimpleTest.cs Log Message: added an older test case back in. Index: SimpleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SimpleTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleTest.cs 10 Feb 2004 19:16:54 -0000 1.1 --- SimpleTest.cs 16 May 2004 03:49:36 -0000 1.2 *************** *** 23,26 **** --- 23,27 ---- } + [Test] public void TestCRUD() { *************** *** 108,112 **** ! private void OldTestCase() { DateTime now = DateTime.Now; --- 109,114 ---- ! [Test] ! public void SetPropertiesOnQuery() { DateTime now = DateTime.Now; *************** *** 116,119 **** --- 118,122 ---- // create a new + long key = 10; Simple simple = new Simple(); simple.Name = "Simple 1"; *************** *** 122,161 **** simple.Count = 99; ! s.Save(simple, 10); t.Commit(); - s.Close(); - ! // BUG: It looks like the problem is coming here because we now have the sample Entity loaded ! // twice in the entries field for this Session. I don't understand why that would happen ! // because a Dictionary should not allow a key to be in there twice... IQuery q = s.CreateQuery("from s in class Simple where s.Name=:Name and s.Count=:Count"); q.SetProperties(simple); Simple loadedSimple = (Simple)q.List()[0]; ! // Check if save failed ! Assertion.AssertEquals("Save failed", 99, simple.Count); ! Assertion.AssertEquals("Save failed", "Simple 1", simple.Name); ! Assertion.AssertEquals("Save failed", "Street 12", simple.Address); ! Assertion.AssertEquals("Save failed", now.ToString(), simple.Date.ToString()); ! // Check if load failed ! Assertion.AssertNotNull("Unable to load object", loadedSimple); ! Assertion.AssertEquals("Load failed", simple.Count, loadedSimple.Count); ! Assertion.AssertEquals("Load failed", simple.Name, loadedSimple.Name); ! Assertion.AssertEquals("Load failed", simple.Address, loadedSimple.Address); ! Assertion.AssertEquals("Load failed", simple.Date.ToString(), loadedSimple.Date.ToString()); ! ! // The INSERT, UPDATE amd SELECT are performed due to some hacks, ! // see Impl\SessionImpl.cs class AdoHack ! // Btw: when something goes wrong, the transaction remains opened ;-) ! ! // When you set a breakpoint at this line, you'll see the record in the database ! ((Transaction.Transaction)t).AdoTransaction.Commit(); ! //s.Delete(simple); ! // ! // note: this line fails!!!! ! // t.Commit(); s.Close(); --- 125,146 ---- simple.Count = 99; ! s.Save(simple, key); t.Commit(); ! t = s.BeginTransaction(); ! IQuery q = s.CreateQuery("from s in class Simple where s.Name=:Name and s.Count=:Count"); q.SetProperties(simple); Simple loadedSimple = (Simple)q.List()[0]; ! Assert.AreEqual(key, loadedSimple.Key); ! Assert.AreEqual(99, loadedSimple.Count); ! Assert.AreEqual("Simple 1", loadedSimple.Name); ! Assert.AreEqual("Street 12", loadedSimple.Address); ! Assert.AreEqual(now.ToString(), loadedSimple.Date.ToString()); ! s.Delete(simple); ! t.Commit(); s.Close(); |
From: Michael D. <mik...@us...> - 2004-05-16 03:35:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17682 Removed Files: NHibernate.ndoc Log Message: ndoc instructions are now inside the build file. --- NHibernate.ndoc DELETED --- |
From: Michael D. <mik...@us...> - 2004-05-14 12:09:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10975/src/NHibernate.Test Modified Files: NHibernate.Test.build Log Message: major overhaul of build files in preparation for build 3. Thanks to NAnt for providing a good build file that I shamelessly used to make up NHibernate's build files. Index: NHibernate.Test.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test.build,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NHibernate.Test.build 19 Mar 2004 19:40:26 -0000 1.2 --- NHibernate.Test.build 14 May 2004 12:08:58 -0000 1.3 *************** *** 1,82 **** <?xml version="1.0" ?> ! <project name="NHibernate" default="buildDebug" basedir="." xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd"> ! ! <property name="nant.settings.currentframework" value="net-1.1" /> ! <property name="external.bin" value="../../external-bin" /> ! <property name="NHibernate.DomainModel.bin" value="../NHibernate.DomainModel/bin" /> ! <property name="NHibernate.bin" value="../NHibernate/bin" /> ! <target name="buildDebug"> ! <delete dir="bin/Debug" failonerror="false" /> ! <mkdir dir="bin/Debug" /> - <csc target="library" output="bin/Debug/NHibernate.Test.dll" debug="true"> <references> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> ! <includes name="${external.bin}/DotNetMock.dll" /> ! <includes name="${external.bin}/DotNetMock.Framework.dll" /> ! <includes name="${external.bin}/log4net.dll" /> ! <includes name="${external.bin}/nunit.framework.dll"/> ! <includes name="${NHibernate.DomainModel.bin}/Debug/NHibernate.DomainModel.dll" /> ! <includes name="${NHibernate.bin}/Debug/NHibernate.dll" /> </references> - <sources> - <includes name="**/*.cs" /> - </sources> - </csc> - - <copy - file="App.config" - tofile="bin/Debug/NHibernate.Test.dll.config" - /> - - <copy todir="bin/Debug"> - <fileset basedir="${external.bin}"> - <includes name="log4net.*" /> - </fileset> - </copy> - <copy todir="bin/Debug"> - <fileset basedir="${external.bin}"> - <includes name="DotNetMock.*" /> - </fileset> - </copy> - <copy todir="bin/Debug"> - <fileset basedir="${external.bin}"> - <includes name="nunit.framework.*" /> - </fileset> - </copy> - <copy todir="bin/Debug"> - <fileset basedir="${NHibernate.DomainModel.bin}/Debug"> - <includes name="*.*" /> - </fileset> - </copy> - <copy todir="bin/Debug"> - <fileset basedir="${NHibernate.bin}/Debug"> - <includes name="*.*" /> - </fileset> - </copy> - </target> - - <target name="buildRelease"> - - <delete dir="bin/Release" failonerror="false" /> - <mkdir dir="bin/Release" /> - - <csc target="library" output="bin/Release/NHibernate.Test.dll" debug="false"> - <references> - <includes name="System.dll" /> - <includes name="System.XML.dll" /> - <includes name="System.Data.dll" /> - <includes name="${external.bin}/DotNetMock.dll" /> - <includes name="${external.bin}/DotNetMock.Framework.dll" /> - <includes name="${external.bin}/log4net.dll" /> - <includes name="${external.bin}/nunit.framework.dll"/> - <includes name="${NHibernate.DomainModel.bin}/Debug/NHibernate.DomainModel.dll" /> - <includes name="${NHibernate.bin}/Debug/NHibernate.dll" /> - </references> <sources> <includes name="**/*.cs" /> --- 1,31 ---- <?xml version="1.0" ?> ! ! <project ! name="NHibernate.Test" ! default="build" ! xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" ! > ! <target name="build"> ! <csc ! target="library" ! define="${current.build.defines}" ! debug="${build.debug}" ! output="${build.dir}/bin/${nant.project.name}.dll" ! > <references> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> ! <includes name="${build.dir}/bin/DotNetMock.dll" /> ! <includes name="${build.dir}/bin/DotNetMock.Framework.dll" /> ! <includes name="${build.dir}/bin/log4net.dll" /> ! <includes name="${build.dir}/bin/nunit.framework.dll"/> ! <includes name="${build.dir}/bin/NHibernate.DomainModel.dll" /> ! <includes name="${build.dir}/bin/NHibernate.dll" /> </references> <sources> <includes name="**/*.cs" /> *************** *** 86,120 **** <copy file="App.config" ! tofile="bin/Debug/NHibernate.Test.dll.config" /> - - <copy todir="bin/Release"> - <fileset basedir="${external.bin}"> - <includes name="log4net.*" /> - </fileset> - </copy> - - <copy todir="bin/Release"> - <fileset basedir="${external.bin}"> - <includes name="DotNetMock.*" /> - </fileset> - </copy> - <copy todir="bin/Release"> - <fileset basedir="${external.bin}"> - <includes name="nunit.framework.*" /> - </fileset> - </copy> - - <copy todir="bin/Release"> - <fileset basedir="${NHibernate.DomainModel.bin}/Release"> - <includes name="*.*" /> - </fileset> - </copy> - - <copy todir="bin/Release"> - <fileset basedir="${NHibernate.bin}/Release"> - <includes name="*.*" /> - </fileset> - </copy> </target> --- 35,40 ---- <copy file="App.config" ! tofile="${build.dir}/bin/NHibernate.Test.dll.config" /> </target> *************** *** 122,127 **** <target name="test"> <nunit2> ! <formatter type="Xml" usefile="true" extension=".xml" /> ! <test assemblyname="bin/Debug/NHibernate.Test.dll" appconfig="bin/Debug/NHibernate.Test.dll.config" /> </nunit2> </target> --- 42,47 ---- <target name="test"> <nunit2> ! <formatter type="Xml" usefile="true" extension=".xml" outputdir="${build.dir}/bin" /> ! <test assemblyname="${build.dir}/bin/NHibernate.Test.dll" appconfig="${build.dir}/bin/NHibernate.Test.dll.config" /> </nunit2> </target> |
From: Michael D. <mik...@us...> - 2004-05-14 12:09:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10975/src/NHibernate.DomainModel Modified Files: NHibernate.DomainModel.build Log Message: major overhaul of build files in preparation for build 3. Thanks to NAnt for providing a good build file that I shamelessly used to make up NHibernate's build files. Index: NHibernate.DomainModel.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.build,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHibernate.DomainModel.build 10 Feb 2004 19:11:44 -0000 1.1 --- NHibernate.DomainModel.build 14 May 2004 12:08:57 -0000 1.2 *************** *** 1,46 **** <?xml version="1.0" ?> ! <project name="NHibernate.DomainModel" default="buildDebug" basedir="." xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd"> ! ! <property name="nant.settings.currentframework" value="net-1.1" /> ! <property name="externalBin" value="../../external-bin" /> ! ! ! <target name="buildDebug"> ! <delete dir="bin/Debug" failonerror="false" /> ! <mkdir dir="bin/Debug" /> - <csc target="library" output="bin/Debug/NHibernate.DomainModel.dll" debug="true"> <references> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> </references> <resources prefix="NHibernate.DomainModel" dynamicprefix="true"> <includes name="**/*.xml" /> <excludes name="bin/**/*.xml" /> </resources> - <sources> - <includes name="**/*.cs" /> - </sources> - </csc> ! </target> ! ! <target name="buildRelease"> ! ! <delete dir="bin/Release" failonerror="false" /> ! <mkdir dir="bin/Release" /> ! ! <csc target="library" output="bin/Release/NHibernate.DomainModel.dll" debug="false"> ! <references> ! <includes name="System.dll" /> ! <includes name="System.XML.dll" /> ! <includes name="System.Data.dll" /> ! </references> ! <resources prefix="NHibernate.DomainModel" dynamicprefix="true"> ! <includes name="**/*.xml" /> ! </resources> ! <sources> <includes name="**/*.cs" /> </sources> --- 1,38 ---- <?xml version="1.0" ?> ! ! <project ! name="NHibernate.DomainModel" ! default="build" ! xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" ! > ! ! <!-- ! Required properties: ! * build.dir - (path) root level to build to, assemblies will go in ${build.dir}/bin ! * build.debug - (true|false) debug build? ! * current.build.defines - framework-specific build defines ! --> ! <target name="build" description="Build the DomainModel that will be used by the Tests"> ! <csc ! target="library" ! define="${current.build.defines}" ! debug="${build.debug}" ! output="${build.dir}/bin/${nant.project.name}.dll" ! > <references> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> + <includes name="${build.dir}/bin/NHibernate.dll" /> </references> + <resources prefix="NHibernate.DomainModel" dynamicprefix="true"> <includes name="**/*.xml" /> <excludes name="bin/**/*.xml" /> </resources> ! <sources failonempty="true"> <includes name="**/*.cs" /> </sources> |
From: Michael D. <mik...@us...> - 2004-05-14 12:09:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10975/src/NHibernate Modified Files: nhibernate.build Log Message: major overhaul of build files in preparation for build 3. Thanks to NAnt for providing a good build file that I shamelessly used to make up NHibernate's build files. Index: nhibernate.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate.build,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** nhibernate.build 6 May 2004 20:55:53 -0000 1.9 --- nhibernate.build 14 May 2004 12:08:56 -0000 1.10 *************** *** 1,24 **** <?xml version="1.0" ?> - <project name="NHibernate" default="buildDebug" basedir="." xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd"> - <property name="nant.settings.currentframework" value="net-1.1" /> ! <property name="external.bin" value="../../external-bin" /> ! <target name="buildDebug"> ! <delete dir="bin/Debug" failonerror="false" /> ! <mkdir dir="bin/Debug" /> ! <csc target="library" output="bin/Debug/NHibernate.dll" debug="true"> ! <references> ! <includes name="System.dll" /> ! <includes name="System.XML.dll" /> ! <includes name="System.Data.dll" /> ! <includes name="${external.bin}/log4net.dll" /> ! </references> ! <resources prefix="NHibernate" dynamicprefix="true"> ! <includes name="*.xsd" /> ! <includes name="**/*.xml" /> ! <excludes name="bin/**/*.xml" /> ! </resources> ! <sources> <includes name="**/*.cs" /> <excludes name="Eg/**" /> --- 1,29 ---- <?xml version="1.0" ?> ! <project ! name="NHibernate" ! default="build" ! xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" ! > ! ! <!-- ! Required properties: ! * build.dir - (path) root level to build to, assemblies will go in ${build.dir}/bin ! * build.debug - (true|false) debug build? ! * current.build.defines - framework-specific build defines ! --> ! ! <target name="build" description="Build NHibernate"> ! ! <csc ! target="library" ! define="${current.build.defines}" ! debug="${build.debug}" ! output="${build.dir}/bin/${nant.project.name}.dll" ! doc="${build.dir}/bin/${nant.project.name}.xml" ! > ! ! <sources failonempty="true"> <includes name="**/*.cs" /> <excludes name="Eg/**" /> *************** *** 35,57 **** <excludes name="Tool/hbm2net/*.cs" /> </sources> - </csc> - <copy todir="bin/Debug"> - <fileset basedir="${external.bin}"> - <includes name="log4net.*" /> - </fileset> - </copy> - </target> - - <target name="buildRelease"> - <delete dir="bin/Release" failonerror="false" /> - <mkdir dir="bin/Release" /> - <csc target="library" output="bin/Release/NHibernate.dll" debug="false"> - <references> - <includes name="System.dll" /> - <includes name="System.XML.dll" /> - <includes name="System.Data.dll" /> - <includes name="${external.bin}/log4net.dll" /> - </references> <resources prefix="NHibernate" dynamicprefix="true"> <includes name="*.xsd" /> --- 40,44 ---- *************** *** 59,96 **** <excludes name="bin/**/*.xml" /> </resources> - <sources> - <includes name="**/*.cs" /> - <excludes name="Eg/**" /> - <excludes name="InternalTest/**/*.cs" /> - <excludes name="Test/**/*.cs" /> - <excludes name="Util/*Test.cs" /> - <excludes name="Dialect/DB2Dialect.cs" /> - <excludes name="Dialect/HSQLDialect.cs" /> - <excludes name="Dialect/InterbaseDialect.cs" /> - <excludes name="Dialect/Oracle9Dialect.cs" /> - <excludes name="Dialect/OracleDialect.cs" /> - <excludes name="Dialect/SAPDBDialect.cs" /> - <excludes name="Sql/ANSIOuterJoinFragment.cs" /> - <excludes name="Tool/hbm2net/*.cs" /> - </sources> - </csc> - <copy todir="bin/Release"> - <fileset basedir="${external.bin}"> - <includes name="log4net.*" /> - </fileset> - </copy> </target> - <!-- - <csc target="exe" output="bin/nant/hbm2ddl.exe" debug="false"> - <references> - - - <includes name="bin/nant/NHibernate.dll" /> - - - <includes name="bin/Debug/NHibernate.dll" /> - </references> - <sources> - <includes name="Tool/hbm2ddl/SchemaExport.cs" /> - </sources> - </csc> - --> </project> \ No newline at end of file --- 46,60 ---- <excludes name="bin/**/*.xml" /> </resources> + <references basedir="${build.dir}/bin"> + <includes name="System.dll" /> + <includes name="System.XML.dll" /> + <includes name="System.Data.dll" /> + <includes name="log4net.dll" /> + </references> + + </csc> + </target> </project> \ No newline at end of file |
From: Michael D. <mik...@us...> - 2004-05-14 12:09:07
|
Update of /cvsroot/nhibernate/nhibernate/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10975/src Removed Files: NHibernateSolution.build Log Message: major overhaul of build files in preparation for build 3. Thanks to NAnt for providing a good build file that I shamelessly used to make up NHibernate's build files. --- NHibernateSolution.build DELETED --- |
From: Michael D. <mik...@us...> - 2004-05-14 12:09:06
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10975 Added Files: NHibernateSolution.build sample build commands.txt Log Message: major overhaul of build files in preparation for build 3. Thanks to NAnt for providing a good build file that I shamelessly used to make up NHibernate's build files. --- NEW FILE: sample build commands.txt --- ## ## This file contains sample commands to build NHibernate using the build files. ## It should be run from the nhibernate directory that contains the ## NHibernateSolution.build file. ## ## If you are going to run the Test make sure to set the connection information. ## ## NAnt -D:project.config=release clean build >output-release-build.log NAnt clean build >output-debug-build.log NAnt -D:project.config=release -D:nhibernate.dialect="NHibernate.Dialect.MsSql2000Dialect" -D:nhibernate.connection.driver_class="NHibernate.Driver.SqlClientDriver" -D:nhibernate.connection.connection_string="Server=localhost;initial catalog=nhibernate;User ID=blah;Password=blah;Min Pool Size=2" clean package >output-release-package.log --- NEW FILE: NHibernateSolution.build --- <?xml version="1.0" ?> <project name="NHibernateSolution" default="build" xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" > <!-- global project settings --> <property name="project.name" value="nhibernate" /> <property name="project.version" value="0.0.5000.3" /> <!-- default configuration --> <property name="project.config" value="debug" /> <!-- debug|release --> <property name="build.defines" value="" /> <!-- named project configurations --> <target name="debug" description="Perform a 'debug' build"> <property name="project.config" value="debug" /> <property name="build.debug" value="true" /> <property name="build.dir" value="${nant.project.basedir}/build/${project.name}-${project.version}-${project.config}" /> </target> <target name="release" description="Perform a 'release' build"> <property name="project.config" value="release" /> <property name="build.debug" value="false" /> <property name="build.dir" value="${nant.project.basedir}/build/${project.name}-${project.version}" /> </target> <target name="init" description="Initializes build properties"> <call target="${project.config}" /> <call target="set-runtime-configuration" /> </target> <target name="clean" depends="init" description="Deletes current build"> <delete dir="${build.dir}" failonerror="false" /> </target> <target name="cleanall" description="Deletes every build configuration"> <echo message="Deleting all builds from all configurations" /> <delete dir="build" failonerror="false" /> </target> <target name="build" depends="init" description="Builds current configuration"> <echo message="Current Directory is ${nant.project.basedir}" /> <echo message="Build Directory is ${build.dir}" /> <!-- prepare build directory --> <mkdir dir="${build.dir}/bin" /> <!-- copy framework-nuetral libraries --> <copy todir="${build.dir}/bin"> <fileset basedir="external-bin"> <includes name="log4net.*" /> <includes name="DotNetMock.*" /> <includes name="nunit.framework.*" /> </fileset> </copy> <!-- copy framework-specific libraries --> <!-- note that we are not targeting diff versions - only 1.1 and not mono yet --> <nant buildfile="src/NHibernate/NHibernate.build" target="build" /> <nant buildfile="src/NHibernate.DomainModel/NHibernate.DomainModel.build" target="build" /> <nant buildfile="src/NHibernate.Test/NHibernate.Test.build" target="build" /> </target> <target name="test" depends="build" description="Runs the tests contained in NHibernate.Test" > <!-- Tell nhibernate how to connect to the test database. --> <xmlpoke file="${build.dir}/bin/NHibernate.Test.dll.config" xpath="/configuration/nhibernate/add[@key='hibernate.dialect']/@value" value="${nhibernate.dialect}" /> <xmlpoke file="${build.dir}/bin/NHibernate.Test.dll.config" xpath="/configuration/nhibernate/add[@key='hibernate.connection.driver_class']/@value" value="${nhibernate.connection.driver_class}" /> <xmlpoke file="${build.dir}/bin/NHibernate.Test.dll.config" xpath="/configuration/nhibernate/add[@key='hibernate.connection.connection_string']/@value" value="${nhibernate.connection.connection_string}" /> <nant buildfile="src/NHibernate.Test/NHibernate.Test.build" target="test" /> <!-- Remove the connnection string information that was just entered... --> <xmlpoke file="${build.dir}/bin/NHibernate.Test.dll.config" xpath="/configuration/nhibernate/add[@key='hibernate.connection.connection_string']/@value" value="conn string here" /> </target> <target name="set-runtime-configuration"> <!-- We are not building for anything but the .net 1.1 framework right now --> <call target="set-net-1.1-runtime-configuration" /> <!-- <ifnot propertyexists="current.runtime.config"> <ifnot propertyexists="nant.settings.currentframework"> <fail message="No runtime configuration was specified and the default NAnt runtime is not available." /> </ifnot> <ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration"> <fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by NAnt." /> </ifnot> <call target="set-${nant.settings.currentframework}-runtime-configuration"/> </ifnot> <ifnot propertyexists="current.runtime.version"> <ifnot propertyexists="nant.settings.currentframework"> <fail message="No runtime configuration was specified and the default NAnt runtime is not available." /> </ifnot> <ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration"> <fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by NDoc." /> </ifnot> <call target="set-${nant.settings.currentframework}-runtime-configuration" /> </ifnot> <ifnot targetexists="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration"> <fail message="The ${current.runtime.config}-${current.runtime.version} runtime is not supported by NDoc." /> </ifnot> <call target="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration"/> --> </target> <target name="set-runtime-configuration-flags"> <property name="current.runtime.config.net" value="false" /> <property name="current.runtime.config.netcf" value="false" /> <property name="current.runtime.config.mono" value="false" /> <property name="current.runtime.config.sscli" value="false" /> <property name="current.runtime.config.${current.runtime.config}" value="true" /> <property name="current.runtime.net-1.0" value="false" /> <property name="current.runtime.net-1.1" value="false" /> <property name="current.runtime.net-1.2" value="false" /> <property name="current.runtime.netcf-1.0" value="false" /> <property name="current.runtime.mono-1.0" value="false" /> <property name="current.runtime.sscli-1.0" value="false" /> <property name="current.runtime.${current.runtime.config}-${current.runtime.version}" value="true" /> </target> <target name="set-net-1.1-runtime-configuration"> <property name="current.runtime.config" value="net" /> <property name="current.runtime.version" value="1.1" /> <property name="current.runtime.description" value="Microsoft .NET Framework 1.1" /> <property name="current.build.defines" value="${build.defines}NET,NET_1_1" /> <property name="link.sdkdoc.version" value="SDK_v1_1" /> <property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" /> <property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" /> <call target="set-runtime-configuration-flags" /> </target> <target name="sdkdoc" depends="init" description="Generates MSDN sytle documentation"> <ndoc> <assemblies basedir="${build.dir}/bin"> <includes name="NHibernate.dll" /> </assemblies> <documenters> <documenter name="MSDN"> <property name="OutputDirectory" value="${build.dir}/doc/sdk" /> <property name="HtmlHelpName" value="NHibernate-SDK" /> <property name="IncludeFavorites" value="False" /> <property name="Title" value="NHibernate Class Library - v.${project.version}" /> <property name="SplitTOCs" value="False" /> <property name="DefaulTOC" value="" /> <property name="IncludeHierarchy" value="False" /> <property name="ShowVisualBasic" value="False" /> <property name="RootPageContainsNamespaces" value="False" /> <property name="SortTOCByNamespace" value="True" /> <property name="OutputTarget" value="HtmlHelp" /> <property name="HeaderHtml" value="" /> <property name="FooterHtml" value="" /> <property name="FilesToInclude" value="" /> <property name="LinkToSdkDocVersion" value="SDK_v1_1" /> <property name="ShowMissingSummaries" value="${build.debug}" /> <property name="ShowMissingRemarks" value="${build.debug}" /> <property name="ShowMissingParams" value="${build.debug}" /> <property name="ShowMissingReturns" value="${build.debug}" /> <property name="ShowMissingValues" value="${build.debug}" /> <property name="DocumentInternals" value="False" /> <property name="DocumentProtected" value="True" /> <property name="DocumentPrivates" value="False" /> <property name="DocumentProtectedInternalAsProtected" value="False" /> <property name="DocumentEmptyNamespaces" value="False" /> <property name="IncludeAssemblyVersion" value="False" /> <property name="CopyrightText" value="" /> <property name="CopyrightHref" value="" /> <property name="ReferencesPath" value="" /> <property name="SkipNamespacesWithoutSummaries" value="False" /> <property name="UseNamespaceDocSummaries" value="False" /> <property name="AutoPropertyBackerSummaries" value="False" /> <property name="AutoDocumentConstructors" value="True" /> <property name="DocumentAttributes" value="False" /> <property name="ShowTypeIdInAttributes" value="False" /> <property name="DocumentedAttributes" value="" /> <property name="GetExternalSummaries" value="True" /> <property name="EditorBrowsableFilter" value="Off" /> <property name="UseNDocXmlFile" value="" /> </documenter> </documenters> </ndoc> </target> <target name="package" depends="test sdkdoc" description="Creates Zip files for the File Release System on SourceForge"> <copy todir="${build.dir}"> <fileset> <!-- exclude the UnitTesting project that is no longer used --> <excludes name="src/UnitTesting/**" /> <includes name="src/**" /> <!-- exclude VS.NET stuff --> <excludes name="**/*.suo" /> <excludes name="**/*j.user" /> <excludes name="**/bin/**" /> <excludes name="**/obj/**" /> </fileset> </copy> <property name="project.zip-path" value="${nant.project.basedir}/build/${project.name}-${project.version}.zip" /> <zip zipfile="${project.zip-path}"> <fileset basedir="${build.dir}"> <includes name="**/*" /> </fileset> </zip> <echo message="Create a '${project.config}' package ast file://${project.zip-path}" /> </target> </project> |
From: Peter S. <sz...@us...> - 2004-05-13 13:45:26
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8579/NHibernate/Impl Modified Files: SessionFactoryImpl.cs Log Message: Inserted cache into close, should finish after statementcache Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** SessionFactoryImpl.cs 13 May 2004 12:23:58 -0000 1.16 --- SessionFactoryImpl.cs 13 May 2004 13:45:16 -0000 1.17 *************** *** 643,647 **** { log.Info("Closing"); ! // nothing else to do unitl we get the caches working. } --- 643,667 ---- { log.Info("Closing"); ! ! foreach(IClassPersister p in classPersisters.Values) ! { ! if ( p.HasCache ) p.Cache.Destroy(); ! } ! ! foreach(CollectionPersister p in collectionPersisters.Values) ! { ! if ( p.HasCache ) p.Cache.Destroy(); ! } ! ! // TODO: H2.0.3 ! // if (statementCache!=null) statementCache.CloseAll(); ! // try ! // { ! // connections.close(); ! // } ! // finally ! // { ! // SessionFactoryObjectFactory.removeInstance(uuid, name, properties); ! // } } |
From: Michael D. <mik...@us...> - 2004-05-13 12:24:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24502/Impl Modified Files: SessionFactoryImpl.cs Log Message: Fixed Cache reference for Collections. Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SessionFactoryImpl.cs 12 May 2004 21:17:08 -0000 1.15 --- SessionFactoryImpl.cs 13 May 2004 12:23:58 -0000 1.16 *************** *** 661,665 **** { CollectionPersister p = GetCollectionPersister(roleName); ! if(p.HasCache) p.Cache.Remove(id); } --- 661,665 ---- { CollectionPersister p = GetCollectionPersister(roleName); ! if(p.HasCache) p.CacheConcurrencyStrategy.Remove(id); } *************** *** 667,671 **** { CollectionPersister p = GetCollectionPersister(roleName); ! if(p.HasCache) p.Cache.Clear(); } } --- 667,671 ---- { CollectionPersister p = GetCollectionPersister(roleName); ! if(p.HasCache) p.CacheConcurrencyStrategy.Clear(); } } |
From: Michael D. <mik...@us...> - 2004-05-12 21:17:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15002/Impl Modified Files: SessionFactoryImpl.cs Log Message: Uncommented code that was waiting on the Cache. Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SessionFactoryImpl.cs 15 Apr 2004 11:36:35 -0000 1.14 --- SessionFactoryImpl.cs 12 May 2004 21:17:08 -0000 1.15 *************** *** 655,660 **** { IClassPersister p = GetPersister(persistentClass); ! //TODO: H2.0.3 uncomment when Cache is synched ! //if(p.HasCache) p.Cache.Clear(); } --- 655,659 ---- { IClassPersister p = GetPersister(persistentClass); ! if(p.HasCache) p.Cache.Clear(); } *************** *** 662,667 **** { CollectionPersister p = GetCollectionPersister(roleName); ! // TODO: H2.0.3 uncomment this when CollectionPersister has cache ! //if(p.HasCache) p.Cache.Remove(id); } --- 661,665 ---- { CollectionPersister p = GetCollectionPersister(roleName); ! if(p.HasCache) p.Cache.Remove(id); } *************** *** 669,674 **** { CollectionPersister p = GetCollectionPersister(roleName); ! // TODO: H2.0.3 uncomment this when CollectionPersister has cache ! //if(p.HasCache) p.Cache.Clear(); } } --- 667,671 ---- { CollectionPersister p = GetCollectionPersister(roleName); ! if(p.HasCache) p.Cache.Clear(); } } |
From: Michael D. <mik...@us...> - 2004-05-11 19:47:28
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21767 Modified Files: FooBarTest.cs Log Message: Added ignored test for Cache testing. Appears to be a problem with HQL and parsing of parameters. There is code using "[<" and ">]" as the parameter in code - saw a comment in HQL asking why and I have no idea. Going to fix AdoHack and WhereParser so it works with ? as the parameter. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** FooBarTest.cs 30 Apr 2004 15:51:11 -0000 1.19 --- FooBarTest.cs 11 May 2004 19:47:17 -0000 1.20 *************** *** 18,22 **** "Qux.hbm.xml", "Fum.hbm.xml", ! "Baz.hbm.xml" // "Simple.hbm.xml", // "Fumm.hbm.xml", --- 18,22 ---- "Qux.hbm.xml", "Fum.hbm.xml", ! "Baz.hbm.xml", // "Simple.hbm.xml", // "Fumm.hbm.xml", *************** *** 24,28 **** // "One.hbm.xml", // "Many.hbm.xml", ! // "Immutable.hbm.xml", // "Vetoer.hbm.xml", // "Holder.hbm.xml", --- 24,28 ---- // "One.hbm.xml", // "Many.hbm.xml", ! "Immutable.hbm.xml" // "Vetoer.hbm.xml", // "Holder.hbm.xml", *************** *** 41,44 **** --- 41,45 ---- [Test] + [Ignore("Fails because Proxies are not working.")] public void FetchInitializedCollection() { *************** *** 227,230 **** --- 228,258 ---- s.Close(); } + + [Test] + [Ignore("This is not working until I get parameters and HQL working better.")] + public void Cache() + { + ISession s = sessions.OpenSession(); + Immutable im = new Immutable(); + s.Save(im); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + s.Load( im, im.Id); + s.Close(); + + s = sessions.OpenSession(); + s.Load( im, im.Id); + + Immutable imFromFind = (Immutable)s.Find("from im in class Immutable where im = ?", im, NHibernate.Entity(typeof(Immutable)))[0]; + Immutable imFromLoad = (Immutable)s.Load(typeof(Immutable), im.Id); + + Assert.IsTrue(im==imFromFind, "cached object identity from Find "); + Assert.IsTrue(im==imFromLoad, "cached object identity from Load "); + + s.Close(); + + } } } |
From: Michael D. <mik...@us...> - 2004-05-11 19:45:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21269 Modified Files: Immutable.hbm.xml NHibernate.DomainModel-1.1.csproj Added Files: Immutable.cs Log Message: Added class Immutable to help with Cache testing. --- NEW FILE: Immutable.cs --- using System; namespace NHibernate.DomainModel { /// <summary> /// Summary description for Immutable. /// </summary> public class Immutable { private string foo; private string bar; private string id; public string Foo { get { return foo; } set { foo = value; } } public string Bar { get { return bar; } set { bar = value; } } public string Id { get { return id; } set { id = value; } } } } Index: Immutable.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Immutable.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Immutable.hbm.xml 6 Apr 2004 13:36:18 -0000 1.2 --- Immutable.hbm.xml 11 May 2004 19:44:58 -0000 1.3 *************** *** 1,11 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="net.sf.hibernate.test.Immutable" table="immut" mutable="false"> <jcs-cache usage="read-only" /> ! <id name="id" column="id_" length="64"> <generator class="uuid.hex" /> </id> ! <property name="foo" /> ! <property name="bar" /> </class> </hibernate-mapping> \ No newline at end of file --- 1,11 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Immutable, NHibernate.DomainModel" table="immut" mutable="false"> <jcs-cache usage="read-only" /> ! <id name="Id" column="id_" length="64"> <generator class="uuid.hex" /> </id> ! <property name="Foo" /> ! <property name="Bar" /> </class> </hibernate-mapping> \ No newline at end of file Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NHibernate.DomainModel-1.1.csproj 29 Apr 2004 15:16:00 -0000 1.10 --- NHibernate.DomainModel-1.1.csproj 11 May 2004 19:44:58 -0000 1.11 *************** *** 291,294 **** --- 291,299 ---- /> <File + RelPath = "Immutable.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Immutable.hbm.xml" BuildAction = "EmbeddedResource" |
From: Michael D. <mik...@us...> - 2004-05-11 19:27:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17081 Modified Files: Binder.cs Configuration.cs Log Message: Added code to use jcs-cache element in mapping file. NOTE: this is very likely in a future build to change to something like <cache> instead of <jcs-cache>. Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Binder.cs 3 May 2004 14:33:18 -0000 1.23 --- Binder.cs 11 May 2004 19:26:59 -0000 1.24 *************** *** 263,266 **** --- 263,274 ---- } break; + + case "jcs-cache": + model.Cache = Configuration.CreateCache( + subnode.Attributes["usage"].Value, + model.PersistentClazz.Name, + model ); + + break; } } *************** *** 1084,1087 **** --- 1092,1102 ---- else if ( "many-to-any".Equals(name) ) { Any element = new Any( model.Table ); model.Element = element; BindAny(subnode, element, true); } + else if ( "jcs-cache".Equals(name) ) + { + model.Cache = Configuration.CreateCache( + subnode.Attributes["usage"].Value, + model.Role, + model.Owner ); + } } Index: Configuration.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Configuration.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Configuration.cs 29 Apr 2004 17:46:37 -0000 1.13 --- Configuration.cs 11 May 2004 19:26:59 -0000 1.14 *************** *** 703,706 **** --- 703,730 ---- } + public static ICacheConcurrencyStrategy CreateCache(string usage, string name, PersistentClass owner) + { + log.Info("creating cache region: " + name + ", usage: " + usage); + + ICache cache = new HashtableCache(name); + + switch (usage) + { + case "read-only": + if (owner.IsMutable) log.Warn("read-only cache configured for mutable: " + name); + return new ReadOnlyCache(cache); + + case "read-write": + return new ReadWriteCache(cache); + + case "nonstrict-read-write": + return new NonstrictReadWriteCache(cache); + + default: + throw new MappingException("jcs-cache usage attribute should be read-only, read-write, or nonstrict-read-write only"); + + } + } + /// <summary> /// Get the query language imports |
From: Michael D. <mik...@us...> - 2004-05-06 20:57:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23846 Modified Files: NHibernate.Test-1.1.csproj Log Message: Added CacheFixture to the testing csproj. Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NHibernate.Test-1.1.csproj 29 Apr 2004 15:16:00 -0000 1.18 --- NHibernate.Test-1.1.csproj 6 May 2004 20:57:00 -0000 1.19 *************** *** 223,226 **** --- 223,231 ---- /> <File + RelPath = "CacheTest\CacheFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "DialectTest\DialectFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-05-06 20:57:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CacheTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23846/CacheTest Added Files: CacheFixture.cs Log Message: Added CacheFixture to the testing csproj. --- NEW FILE: CacheFixture.cs --- using System; using NHibernate.Cache; using NUnit.Framework; namespace NHibernate.Test.CacheTest { [TestFixture] public class CacheFixture { [Test] public void TestSimpleCache() { DoTestCache( new HashtableCache("theregion") ); } public void DoTestCache(ICache cache) { long longBefore = Timestamper.Next(); System.Threading.Thread.Sleep(15); long before = Timestamper.Next(); System.Threading.Thread.Sleep(15); ICacheConcurrencyStrategy ccs = new ReadWriteCache(cache); // cache something Assertion.Assert( ccs.Put("foo", "foo", before) ); System.Threading.Thread.Sleep(15); long after = Timestamper.Next(); Assertion.AssertNull( ccs.Get("foo", longBefore) ); Assertion.AssertEquals( "foo", ccs.Get("foo", after) ); Assertion.Assert( !ccs.Put("foo", "foo", before) ); // update it; ccs.Lock("foo"); Assertion.AssertNull( ccs.Get("foo", after) ); Assertion.AssertNull( ccs.Get("foo", longBefore) ); Assertion.Assert( !ccs.Put("foo", "foo", before) ); System.Threading.Thread.Sleep(15); long whileLocked = Timestamper.Next(); Assertion.Assert( !ccs.Put("foo", "foo", whileLocked) ); System.Threading.Thread.Sleep(15); ccs.Release("foo"); Assertion.AssertNull( ccs.Get("foo", after) ); Assertion.AssertNull( ccs.Get("foo", longBefore) ); Assertion.Assert( !ccs.Put("foo", "bar", whileLocked) ); Assertion.Assert( !ccs.Put("foo", "bar", after) ); System.Threading.Thread.Sleep(15); long longAfter = Timestamper.Next(); Assertion.Assert( ccs.Put("foo", "baz", longAfter) ); Assertion.AssertNull( ccs.Get("foo", after) ); Assertion.AssertNull( ccs.Get("foo", whileLocked) ); System.Threading.Thread.Sleep(15); long longLongAfter = Timestamper.Next(); Assertion.AssertEquals("baz", ccs.Get("foo", longLongAfter) ); // update it again, with multiple locks ccs.Lock("foo"); ccs.Lock("foo"); Assertion.AssertNull( ccs.Get("foo", longLongAfter) ); System.Threading.Thread.Sleep(15); whileLocked = Timestamper.Next(); Assertion.Assert( !ccs.Put("foo", "foo", whileLocked) ); System.Threading.Thread.Sleep(15); ccs.Release("foo"); System.Threading.Thread.Sleep(15); long betweenReleases = Timestamper.Next(); Assertion.Assert( !ccs.Put("foo", "bar", betweenReleases) ); Assertion.AssertNull( ccs.Get("foo", betweenReleases) ); System.Threading.Thread.Sleep(15); ccs.Release("foo"); Assertion.Assert( !ccs.Put("foo", "bar", whileLocked) ); System.Threading.Thread.Sleep(15); longAfter = Timestamper.Next(); Assertion.Assert( ccs.Put("foo", "baz", longAfter) ); Assertion.AssertNull( ccs.Get("foo", whileLocked) ); System.Threading.Thread.Sleep(15); longLongAfter = Timestamper.Next(); Assertion.AssertEquals("baz", ccs.Get("foo", longLongAfter) ); } } } |
From: Michael D. <mik...@us...> - 2004-05-06 20:56:03
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23568 Modified Files: NHibernate-1.1.csproj nhibernate.build Log Message: Modified files in the Cache namespace for the csproj. Removed an excludes from the build file because it no longer exists. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** NHibernate-1.1.csproj 6 May 2004 13:19:05 -0000 1.25 --- NHibernate-1.1.csproj 6 May 2004 20:55:53 -0000 1.26 *************** *** 321,350 **** /> <File ! RelPath = "Cache\ICache.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ICacheConcurrencyStrategy.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ICacheTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ReadOnlyCache.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ReadWriteCache.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\SimpleCache.cs" SubType = "Code" BuildAction = "Compile" --- 321,350 ---- /> <File ! RelPath = "Cache\HashtableCache.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ICache.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ICacheConcurrencyStrategy.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\NonstrictReadWriteCache.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ReadOnlyCache.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Cache\ReadWriteCache.cs" SubType = "Code" BuildAction = "Compile" Index: nhibernate.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate.build,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** nhibernate.build 31 Mar 2004 08:48:05 -0000 1.8 --- nhibernate.build 6 May 2004 20:55:53 -0000 1.9 *************** *** 22,26 **** <sources> <includes name="**/*.cs" /> - <excludes name="Cache/*Test.cs" /> <excludes name="Eg/**" /> <excludes name="InternalTest/**/*.cs" /> --- 22,25 ---- *************** *** 62,66 **** <sources> <includes name="**/*.cs" /> - <excludes name="Cache/*Test.cs" /> <excludes name="Eg/**" /> <excludes name="InternalTest/**/*.cs" /> --- 61,64 ---- |
From: Michael D. <mik...@us...> - 2004-05-06 20:54:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23070 Modified Files: CachedItem.cs ICache.cs ICacheConcurrencyStrategy.cs ReadOnlyCache.cs ReadWriteCache.cs Timestamper.cs Added Files: HashtableCache.cs NonstrictReadWriteCache.cs Log Message: synch with H2.0.3. Added a HashtableCache because there is no JCSCache in .NET :) Still need to update Binder to setup the Cache. --- NEW FILE: NonstrictReadWriteCache.cs --- using System; namespace NHibernate.Cache { /// <summary> /// Summary description for NonstrictReadWriteCache. /// </summary> public class NonstrictReadWriteCache : ICacheConcurrencyStrategy { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(NonstrictReadWriteCache)); private static readonly long timeout = 10000; private readonly ICache cache; public NonstrictReadWriteCache(ICache cache) { this.cache = cache; } #region ICacheConcurrencyStrategy Members public object Get(object key, long txTimestamp) { object result = cache.Get(key); if( result!=null & !(result is Int64) ) { if (log.IsDebugEnabled) log.Debug("Cache hit: " + key); return result; } return null; } public bool Put(object key, object value, long txTimestamp) { object result = cache.Get(key); if(result==null) { if (log.IsDebugEnabled) log.Debug("Caching new: " + key); } else if ( (result is Int64) && ( (Int64)result < txTimestamp / Timestamper.OneMs ) ) { // note that this is not guaranteed to be correct in a cluster // because system times could be inconsistent if(log.IsDebugEnabled) log.Debug("Caching invalidated: " + key); } else { return false; // note early exit } cache.Put(key, value); return true; } public void Lock(object key) { // in case the server crashes, we need the lock to timeout cache.Put( key, ( timeout + Timestamper.Next() / Timestamper.OneMs ) ); } public void Release(object key) { if(log.IsDebugEnabled) log.Debug("Invalidating: " + key); //remove the lock (any later transactions can recache) cache.Put(key, Timestamper.Next() / Timestamper.OneMs); } public void Remove(object key) { if(log.IsDebugEnabled) log.Debug("Removing: " + key); cache.Remove(key); } public void Clear() { if(log.IsDebugEnabled) log.Debug("Clearing"); cache.Clear(); } public void Destroy() { try { cache.Destroy(); } catch(Exception e) { log.Warn("Could not destroy cache", e); } } #endregion } } Index: CachedItem.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CachedItem.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CachedItem.cs 29 Apr 2004 14:00:51 -0000 1.2 --- CachedItem.cs 6 May 2004 20:53:59 -0000 1.3 *************** *** 3,7 **** namespace NHibernate.Cache { - /// <summary> /// An item of cached data, timestamped with the time it was cached, when it was locked, --- 3,6 ---- *************** *** 25,28 **** --- 24,30 ---- } + /// <summary> + /// The timestamp on the Cached Data. + /// </summary> public long FreshTimestamp { *************** *** 35,38 **** --- 37,43 ---- } + /// <summary> + /// The actual cached Data. + /// </summary> public object Value { *************** *** 40,43 **** --- 45,52 ---- } + /// <summary> + /// A boolean indicating if the Cached Item is fresh. + /// </summary> + /// <value>true if the CachedItem has not ever been locked.</value> public bool IsFresh { *************** *** 45,48 **** --- 54,60 ---- } + /// <summary> + /// Lock the Item. + /// </summary> public void Lock() { *************** *** 53,56 **** --- 65,71 ---- } } + /// <summary> + /// Unlock the Item + /// </summary> public void Unlock() { *************** *** 60,63 **** --- 75,83 ---- } } + + /// <summary> + /// Value indicating if the CachedItem is unlocked. + /// </summary> + /// <value>true if there are no locks on the CachedItem.</value> public bool IsUnlocked { Index: Timestamper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/Timestamper.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Timestamper.cs 29 Apr 2004 14:00:51 -0000 1.5 --- Timestamper.cs 6 May 2004 20:53:59 -0000 1.6 *************** *** 11,15 **** /// strickly increasing, but usually are. /// </remarks> ! public class Timestamper { private static short counter = 0; --- 11,15 ---- /// strickly increasing, but usually are. /// </remarks> ! public sealed class Timestamper { private static short counter = 0; Index: ICacheConcurrencyStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICacheConcurrencyStrategy.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ICacheConcurrencyStrategy.cs 17 Feb 2003 18:16:13 -0000 1.1 --- ICacheConcurrencyStrategy.cs 6 May 2004 20:53:59 -0000 1.2 *************** *** 1,18 **** using System; ! namespace NHibernate.Cache { ! /// <summary> /// Implementors manage transactional access to cached data. /// </summary> /// <remarks> /// Transactions pass in a timestamp indicating transaction start time. /// </remarks> ! public interface ICacheConcurrencyStrategy { ! /// <summary> ! /// Attempt to cache an object /// </summary> ! /// <param name="key">The key</param> /// <param name="txTimestamp">A timestamp prior to the transaction start time</param> /// <returns>The cached object or <c>null</c></returns> --- 1,25 ---- using System; ! namespace NHibernate.Cache ! { /// <summary> /// Implementors manage transactional access to cached data. /// </summary> /// <remarks> + /// <para> /// Transactions pass in a timestamp indicating transaction start time. + /// </para> + /// <para> + /// When used to Cache Entities and Collections the <c>key</c> is the <c>id</c> of the + /// Entity/Collection and the <c>value</c> should be set to the <see cref="Impl.CacheEntry"/> + /// for an Entity and the results of <see cref="PeristentCollection"/>.Disassemble for a Collection. + /// </para> /// </remarks> ! public interface ICacheConcurrencyStrategy ! { /// <summary> ! /// Attempt to retrieve an object from the Cache /// </summary> ! /// <param name="key">The key (id) of the object to get out of the Cache.</param> /// <param name="txTimestamp">A timestamp prior to the transaction start time</param> /// <returns>The cached object or <c>null</c></returns> *************** *** 21,27 **** /// <summary> ! /// Attempt to retrieve an object from the cache /// </summary> ! /// <param name="key">The key</param> /// <param name="value">The value</param> /// <param name="txTimestamp">A timestamp prior to the transaction start time</param> --- 28,34 ---- /// <summary> ! /// Attempt to Cache an object /// </summary> ! /// <param name="key">The key (id) of the object to put in the Cache.</param> /// <param name="value">The value</param> /// <param name="txTimestamp">A timestamp prior to the transaction start time</param> *************** *** 43,46 **** --- 50,74 ---- /// <exception cref="CacheException"></exception> void Release(object key); + + /// <summary> + /// + /// </summary> + /// <param name="key"></param> + /// <exception cref="CacheException"></exception> + void Remove(object key); + + /// <summary> + /// + /// </summary> + /// <param name="key"></param> + /// <exception cref="CacheException"></exception> + void Clear(); + + /// <summary> + /// + /// </summary> + /// <param name="key"></param> + /// <exception cref="CacheException"></exception> + void Destroy(); } } Index: ICache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICache.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ICache.cs 17 Feb 2003 18:16:13 -0000 1.1 --- ICache.cs 6 May 2004 20:53:59 -0000 1.2 *************** *** 1,23 **** using System; ! namespace NHibernate.Cache { ! /// <summary> /// Implementors define a caching algorithm. /// </summary> /// <remarks> ! /// All implementations MUST be threadsafe /// </remarks> ! public interface ICache { /// <summary> ! /// Gets or sets cached data /// </summary> ! /// <value>The cached object or <c>null</c></value> /// <exception cref="CacheException"></exception> ! object this [object key] { ! get; ! set; ! } } --- 1,53 ---- using System; ! namespace NHibernate.Cache ! { /// <summary> /// Implementors define a caching algorithm. /// </summary> /// <remarks> ! /// All implementations MUST be threadsafe. ! /// ! /// <para> ! /// The key is the <c>id</c> of the object that is being cached and the ! /// value is a <see cref="CachedItem"/>. ! /// </para> /// </remarks> ! public interface ICache ! { /// <summary> ! /// Get the object from the Cache /// </summary> ! /// <param name="key"></param> ! /// <returns></returns> ! object Get(object key); ! ! void Put(object key, object value); ! ! /// <summary> ! /// Remove an item from the Cache. ! /// </summary> ! /// <param name="key">The Key of the Item in the Cache to remove.</param> /// <exception cref="CacheException"></exception> ! void Remove(object key); ! ! /// <summary> ! /// Clear the Cache ! /// </summary> ! /// <exception cref="CacheException"></exception> ! void Clear(); ! ! /// <summary> ! /// Clean up. ! /// </summary> ! /// <exception cref="CacheException"></exception> ! void Destroy(); ! ! /// <summary> ! /// Sets the Cache Region name. ! /// </summary> ! /// <exception cref="CacheException"></exception> ! string Region {set;} } --- NEW FILE: HashtableCache.cs --- using System; using System.Collections; using System.Runtime.CompilerServices; namespace NHibernate.Cache { /// <summary> /// A simple <c>Hashtable</c> based cache /// </summary> public class HashtableCache : ICache { private static object synchObject = new object(); private Hashtable cache = new Hashtable(); private string region; public HashtableCache(string region) { this.region = region; } #region ICache Members public object Get(object key) { return cache[key]; } public void Put(object key, object value) { cache[key] = value; } public void Remove(object key) { cache.Remove(key); } public void Clear() { cache.Clear(); } /// <summary> /// Destroys the existing cache by setting it to a new Hashtable. /// </summary> public void Destroy() { cache = new Hashtable(); } public string Region { set { region = value; } } #endregion } } Index: ReadOnlyCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadOnlyCache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReadOnlyCache.cs 23 Apr 2003 14:42:52 -0000 1.3 --- ReadOnlyCache.cs 6 May 2004 20:53:59 -0000 1.4 *************** *** 2,26 **** using System.Runtime.CompilerServices; ! namespace NHibernate.Cache { /// <summary> /// Caches data that is never updated /// </summary> ! public class ReadOnlyCache : ICacheConcurrencyStrategy { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ReadOnlyCache)); ! private ICache cache; ! public ReadOnlyCache(ICache cache) { this.cache = cache; } [MethodImpl(MethodImplOptions.Synchronized)] ! public object Get(object key, long timestamp) { ! object result = cache[key]; if ( result!=null && log.IsDebugEnabled) log.Debug("Cache hit: " + key); return result; } ! public void Lock(object key) { log.Error("Application attempted to edit read only item: " + key); throw new InvalidOperationException("Can't write to a readonly object"); --- 2,33 ---- using System.Runtime.CompilerServices; ! namespace NHibernate.Cache ! { /// <summary> /// Caches data that is never updated /// </summary> ! public class ReadOnlyCache : ICacheConcurrencyStrategy ! { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ReadOnlyCache)); ! private readonly ICache cache; ! public ReadOnlyCache(ICache cache) ! { this.cache = cache; } + #region ICacheConcurrencyStrategy Members + [MethodImpl(MethodImplOptions.Synchronized)] ! public object Get(object key, long timestamp) ! { ! object result = cache.Get(key); if ( result!=null && log.IsDebugEnabled) log.Debug("Cache hit: " + key); return result; } ! public void Lock(object key) ! { log.Error("Application attempted to edit read only item: " + key); throw new InvalidOperationException("Can't write to a readonly object"); *************** *** 30,41 **** public bool Put(object key, object value, long timestamp) { if (log.IsDebugEnabled) log.Debug("Caching: " + key); ! cache[key] = value; return true; } ! public void Release(object key) { log.Error("Application attempted to edit read only item: " + key); throw new InvalidOperationException("Can't write to a readonly object"); } } } --- 37,74 ---- public bool Put(object key, object value, long timestamp) { if (log.IsDebugEnabled) log.Debug("Caching: " + key); ! cache.Put(key, value); return true; } ! public void Release(object key) ! { log.Error("Application attempted to edit read only item: " + key); throw new InvalidOperationException("Can't write to a readonly object"); } + + public void Clear() + { + cache.Clear(); + } + + public void Remove(object key) + { + cache.Remove(key); + } + + public void Destroy() + { + try + { + cache.Destroy(); + } + catch(Exception e) + { + log.Warn("Could not destroy cache", e); + } + } + + #endregion + } } Index: ReadWriteCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadWriteCache.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReadWriteCache.cs 23 Apr 2003 14:42:52 -0000 1.2 --- ReadWriteCache.cs 6 May 2004 20:53:59 -0000 1.3 *************** *** 5,34 **** /// <summary> ! /// Caches data that is sometimes updated while maintaining /// </summary> /// <remarks> /// Works at the "Read Committed" isolation level /// </remarks> ! public class ReadWriteCache : ICacheConcurrencyStrategy { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ReadWriteCache)); ! private ICache cache; ! public ReadWriteCache(ICache cache) { this.cache = cache; } [MethodImpl(MethodImplOptions.Synchronized)] ! public object Get(object key, long txTimestamp) { if (log.IsDebugEnabled) log.Debug("Cache lookup: " + key); ! CachedItem item = cache[key] as CachedItem; if ( item!=null && item.FreshTimestamp < txTimestamp && item.IsFresh // || txTimestamp < item.LockTimestamp ! ) { if (log.IsDebugEnabled) log.Debug("Cache hit: " + key); return item.Value; ! } else { if (log.IsDebugEnabled) log.Debug("Cache miss: " + key); return null; --- 5,43 ---- /// <summary> ! /// Caches data that is sometimes updated while maintaining "read committed" ! /// isolation level. /// </summary> /// <remarks> /// Works at the "Read Committed" isolation level /// </remarks> ! public class ReadWriteCache : ICacheConcurrencyStrategy ! { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ReadWriteCache)); ! private readonly ICache cache; ! public ReadWriteCache(ICache cache) ! { this.cache = cache; } + #region ICacheConcurrencyStrategy Members + [MethodImpl(MethodImplOptions.Synchronized)] ! public object Get(object key, long txTimestamp) ! { if (log.IsDebugEnabled) log.Debug("Cache lookup: " + key); ! CachedItem item = cache.Get(key) as CachedItem; if ( item!=null && item.FreshTimestamp < txTimestamp && item.IsFresh // || txTimestamp < item.LockTimestamp ! ) ! { if (log.IsDebugEnabled) log.Debug("Cache hit: " + key); return item.Value; ! } ! else ! { if (log.IsDebugEnabled) log.Debug("Cache miss: " + key); return null; *************** *** 36,62 **** } ! //TODO: Actually keep locked CacheItems in a different Hashtable in this class until unlocked [MethodImpl(MethodImplOptions.Synchronized)] ! public void Lock(object key) { if (log.IsDebugEnabled) log.Debug("Invalidating: " + key); ! CachedItem item = cache[key] as CachedItem; if ( item==null) item = new CachedItem(null); item.Lock(); ! cache[key] = item; } [MethodImpl(MethodImplOptions.Synchronized)] ! public bool Put(object key, object value, long txTimestamp) { if (log.IsDebugEnabled) log.Debug("Caching: " + key); ! CachedItem item = cache[key] as CachedItem; if ( item==null || (item.IsUnlocked && !item.IsFresh && item.UnlockTimestamp < txTimestamp) ! ) { ! cache[key] = new CachedItem(value); if (log.IsDebugEnabled) log.Debug("Cached: " + key); return true; ! } else { if (log.IsDebugEnabled) log.Debug("Could not cache: " + key); return false; --- 45,79 ---- } ! //TODO: Actually keep locked CacheItems in a different Hashtable ! // in this class until unlocked ! [MethodImpl(MethodImplOptions.Synchronized)] ! public void Lock(object key) ! { if (log.IsDebugEnabled) log.Debug("Invalidating: " + key); ! ! CachedItem item = cache.Get(key) as CachedItem; if ( item==null) item = new CachedItem(null); item.Lock(); ! cache.Put(key, item); } [MethodImpl(MethodImplOptions.Synchronized)] ! public bool Put(object key, object value, long txTimestamp) ! { if (log.IsDebugEnabled) log.Debug("Caching: " + key); ! CachedItem item = cache.Get(key) as CachedItem; if ( item==null || (item.IsUnlocked && !item.IsFresh && item.UnlockTimestamp < txTimestamp) ! ) ! { ! cache.Put(key, new CachedItem(value) ); if (log.IsDebugEnabled) log.Debug("Cached: " + key); return true; ! } ! else ! { if (log.IsDebugEnabled) log.Debug("Could not cache: " + key); return false; *************** *** 65,80 **** [MethodImpl(MethodImplOptions.Synchronized)] ! public void Release(object key) { if (log.IsDebugEnabled) log.Debug("Releasing: " + key); ! CachedItem item = cache[key] as CachedItem; ! if (item != null) { item.Unlock(); ! cache[key] = item; ! } else { log.Warn("An item was expired by the cache while it was locked"); } } } } --- 82,125 ---- [MethodImpl(MethodImplOptions.Synchronized)] ! public void Release(object key) ! { if (log.IsDebugEnabled) log.Debug("Releasing: " + key); ! CachedItem item = cache.Get(key) as CachedItem; ! if (item != null) ! { item.Unlock(); ! cache.Put(key, item); ! } ! else ! { log.Warn("An item was expired by the cache while it was locked"); } } + public void Clear() + { + cache.Clear(); + } + + public void Remove(object key) + { + cache.Remove(key); + } + + public void Destroy() + { + try + { + cache.Destroy(); + } + catch(Exception e) + { + log.Warn("Could not destroy cache", e); + } + } + + #endregion + } } |
From: Michael D. <mik...@us...> - 2004-05-06 20:51:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CacheTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22671/CacheTest Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CacheTest added to the repository |