Permalink
Browse files

- SessionSource.BuildSchema() was not closing the connection which wa…

…s causing problems for non-transient database (SQL Server, non-memory SQLite, etc)

- The rake file now builds the Framework DLL also (instead of just the Core)

git-svn-id: https://fluent-nhibernate.googlecode.com/svn/trunk@171 48f0ce17-cc52-0410-af8c-857c09b6549b
  • Loading branch information...
1 parent f8929ba commit 9bb27e256892310c1f5f12723db70ca8aa9ecd47 @chadmyers chadmyers committed Dec 27, 2008
View
@@ -90,7 +90,7 @@ desc "Compiles the app"
task :compile => [:clean, :version] do
MSBuildRunner.compile :compilemode => COMPILE_TARGET, :solutionfile => 'src/FluentNHibernate.sln', :clrversion => CLR_VERSION
- outDir = "src/FluentNHibernate/bin/#{COMPILE_TARGET}"
+ outDir = "src/FluentNHibernate.Framework/bin/#{COMPILE_TARGET}"
Dir.glob(File.join(outDir, "*.{dll,pdb}")){|file|
copy(file, props[:archive]) if File.file?(file)
@@ -0,0 +1,35 @@
+<Configuration>
+ <SharedSolutionTemplateManager>
+ <LiveTemplates>
+ <Template uid="03229c49-6943-46b2-ba6a-400ac9550f85" text="[Test]&#xD;&#xA;public void $TESTNAME$()&#xD;&#xA;{&#xD;&#xA; $END$&#xD;&#xA;}" shortcut="pvt" description="New Test Case" reformat="true" shortenQualifiedReferences="true">
+ <Context>
+ <CSharpContext context="TypeMember" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="TESTNAME" expression="" initialRange="0" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ </LiveTemplates>
+ <Surrounds />
+ <FileTemplates>
+ <Template uid="482e6087-caae-4484-b5cc-d7b56a938201" text="using NUnit.Framework;&#xD;&#xA;&#xD;&#xA;namespace $Testing_Namespace$&#xD;&#xA;{&#xD;&#xA; [TestFixture]&#xD;&#xA; public class $Test_Fixture_Name$&#xD;&#xA; {&#xD;&#xA; [Test]&#xD;&#xA; public void $Test_Name$()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }&#xD;&#xA; }&#xD;&#xA;}" shortcut="" description="Test Fixture Class" reformat="true" shortenQualifiedReferences="true">
+ <Context>
+ <ProjectLanguageContext language="CSharp" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="Testing_Namespace" expression="fileDefaultNamespace()" initialRange="0" />
+ <Variable name="Test_Fixture_Name" expression="getFileNameWithoutExtension()" initialRange="0" />
+ <Variable name="Test_Name" expression="" initialRange="0" />
+ </Variables>
+ <CustomProperties>
+ <Property key="FileName" value="Class" />
+ <Property key="Extension" value="cs" />
+ <Property key="ValidateFileName" value="False" />
+ </CustomProperties>
+ </Template>
+ </FileTemplates>
+ </SharedSolutionTemplateManager>
+</Configuration>
@@ -59,7 +59,6 @@
<File id="F5DC3221-827E-4CB4-B61C-5F50EB4D32EA/d:AutoMap/f:AutoMapTests.cs" caret="3522" scrollPosition="0|25" />
<File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:Mapping/f:ClassMapBase.cs" caret="599" scrollPosition="0|6" />
<File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:AutoMap/f:AutoMap.cs" caret="1152" scrollPosition="0|0" />
- <File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:Mapping/f:ClassMap.cs" caret="5882" scrollPosition="0|137" />
<File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:AutoMap/f:AutoMapper.cs" caret="252" scrollPosition="0|3" />
<File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:AutoMap/f:AutoMapIdentity.cs" caret="631" scrollPosition="0|0" />
<File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:AutoMap/f:ManyToManyAutoMapper.cs" caret="13" scrollPosition="0|0" />
@@ -69,6 +68,11 @@
<File id="F5DC3221-827E-4CB4-B61C-5F50EB4D32EA/d:AutoMap/f:AutoPersistenceModelTests.cs" caret="6961" scrollPosition="0|153" />
<File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/f:Conventions.cs" caret="3939" scrollPosition="0|27" />
<File id="F5DC3221-827E-4CB4-B61C-5F50EB4D32EA/d:DomainModel/d:Mapping/f:IdentityPartTester.cs" caret="713" scrollPosition="0|12" />
+ <File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/f:PersistenceModel.cs" caret="1236" scrollPosition="0|0" />
+ <File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:AutoMap/f:AutoPersistenceModel.cs" caret="2206" scrollPosition="0|0" />
+ <File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:Mapping/f:ClassMap.cs" caret="2520" scrollPosition="0|19" />
+ <File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:AutoMap/f:ExpressionBuilder.cs" caret="570" scrollPosition="0|0" />
+ <File id="1C988DFB-1EC5-484E-87D9-1D3C775BA435/d:Mapping/f:Template.xml" caret="94" scrollPosition="0|0" />
</RecentFiles>
<RecentEdits>
<File id="F5DC3221-827E-4CB4-B61C-5F50EB4D32EA/d:DomainModel/d:Mapping/f:ClassMapXmlCreationTester.cs" caret="10790" scrollPosition="0|247" />
@@ -57,9 +57,12 @@ public virtual ISession CreateSession()
return _sessionFactory.OpenSession();
}
- public void BuildSchema()
+ public virtual void BuildSchema()
{
- BuildSchema(CreateSession());
+ using( var session = CreateSession())
+ {
+ BuildSchema(session);
+ }
}
public void BuildSchema(ISession session)
@@ -239,14 +239,23 @@ public SingleConnectionSessionSource(IDictionary<string, string> properties, Per
{
}
- public override ISession CreateSession()
+ protected void ensure_current_session()
{
- if(_session == null)
- _session = base.CreateSession();
+ if (_session == null)
+ _session = base.CreateSession();
+ }
+ public override ISession CreateSession()
+ {
+ ensure_current_session();
_session.Clear();
return _session;
}
+
+ public override void BuildSchema()
+ {
+ BuildSchema(CreateSession());
+ }
}
}

0 comments on commit 9bb27e2

Please sign in to comment.