Skip to content

Commit 5e78ad6

Browse files
committed
Merge branch '3.4.x'
2 parents 9f1bbb9 + 49c6b89 commit 5e78ad6

26 files changed

+21751
-18
lines changed

ShowBuildMenu.bat

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,16 @@ echo D. Add a test configuration for SQLite (x86).
5252
echo E. Add a test configuration for SQLite (x64). [not recommended]
5353
echo F. Add a test configuration for PostgreSQL.
5454
echo G. Add a test configuration for Oracle.
55+
echo H. Add a test configuration for SQL Server Compact (x86).
56+
echo I. Add a test configuration for SQL Server Compact (x64).
5557
echo.
5658
echo X. Exit to main menu.
5759
echo.
5860

59-
%BUILDTOOL% prompt ABCDEFGX
60-
if errorlevel 7 goto main-menu
61+
%BUILDTOOL% prompt ABCDEFGHIX
62+
if errorlevel 9 goto main-menu
63+
if errorlevel 8 goto test-setup-sqlservercex64
64+
if errorlevel 7 goto test-setup-sqlservercex86
6165
if errorlevel 6 goto test-setup-oracle
6266
if errorlevel 5 goto test-setup-postgresql
6367
if errorlevel 4 goto test-setup-sqlitex64
@@ -73,6 +77,20 @@ set LIB_FILES=
7377
set LIB_FILES2=
7478
goto test-setup-generic
7579

80+
:test-setup-sqlservercex86
81+
set CONFIG_NAME=SqlServerCe32
82+
set PLATFORM=AnyCPU
83+
set LIB_FILES=lib\teamcity\SqlServerCe\*.dll
84+
set LIB_FILES2=lib\teamcity\SqlServerCe\X86\*.dll
85+
goto test-setup-generic
86+
87+
:test-setup-sqlservercex64
88+
set CONFIG_NAME=SqlServerCe64
89+
set PLATFORM=AnyCPU
90+
set LIB_FILES=lib\teamcity\sqlServerCe\*.dll
91+
set LIB_FILES2=lib\teamcity\sqlServerCe\AMD64\*.dll
92+
goto test-setup-generic
93+
7694
:test-setup-firebirdx86
7795
set CONFIG_NAME=FireBird
7896
set PLATFORM=x86
@@ -259,14 +277,18 @@ echo F. NHibernate Trunk - PostgreSQL
259277
echo G. NHibernate Trunk - Oracle (32-bit)
260278
echo H. NHibernate Trunk - Oracle Managed (32-bit)
261279
echo I. NHibernate Trunk - Oracle Managed (64-bit)
262-
echo J. NHibernate Trunk - SQL Server ODBC (32-bit)
280+
echo J. NHibernate Trunk - SQL Server Compact (32-bit)
281+
echo K. NHibernate Trunk - SQL Server Compact (64-bit)
282+
echo L. NHibernate Trunk - SQL Server ODBC (32-bit)
263283
echo.
264284
echo X. Exit to main menu.
265285
echo.
266286

267-
%BUILDTOOL% prompt ABCDEFGHIJX
268-
if errorlevel 10 goto main-menu
269-
if errorlevel 9 goto teamcity-sqlServerOdbc
287+
%BUILDTOOL% prompt ABCDEFGHIJKLX
288+
if errorlevel 12 goto main-menu
289+
if errorlevel 11 goto teamcity-sqlServerOdbc
290+
if errorlevel 10 goto teamcity-sqlServerCe64
291+
if errorlevel 9 goto teamcity-sqlServerCe32
270292
if errorlevel 8 goto teamcity-oraclemanaged-64
271293
if errorlevel 7 goto teamcity-oraclemanaged-32
272294
if errorlevel 6 goto teamcity-oracle32
@@ -337,5 +359,17 @@ move "%CURRENT_CONFIGURATION%" "%CURRENT_CONFIGURATION%-backup" 2> nul
337359
move "%CURRENT_CONFIGURATION%-backup" "%CURRENT_CONFIGURATION%" 2> nul
338360
goto main-menu
339361

362+
:teamcity-sqlServerCe32
363+
move "%CURRENT_CONFIGURATION%" "%CURRENT_CONFIGURATION%-backup" 2> nul
364+
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=sqlServerCe32
365+
move "%CURRENT_CONFIGURATION%-backup" "%CURRENT_CONFIGURATION%" 2> nul
366+
goto main-menu
367+
368+
:teamcity-sqlServerCe64
369+
move "%CURRENT_CONFIGURATION%" "%CURRENT_CONFIGURATION%-backup" 2> nul
370+
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=sqlServerCe64
371+
move "%CURRENT_CONFIGURATION%-backup" "%CURRENT_CONFIGURATION%" 2> nul
372+
goto main-menu
373+
340374
:end
341375
popd

build-common/common-project.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@
301301
</namespaces>
302302
</xmlpoke>
303303

304+
<xmlpoke file="${app.config}"
305+
xpath="//*/hbm:property[@name='command_timeout']"
306+
value="${nhibernate.command_timeout}">
307+
<namespaces>
308+
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
309+
</namespaces>
310+
</xmlpoke>
311+
304312
<xmlpoke file="${app.config}"
305313
xpath="//*/hbm:property[@name='connection.driver_class']"
306314
value="${nhibernate.connection.driver_class}">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" ?>
22
<project xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">
33
<property name="nhibernate.dialect" value="NHibernate.Dialect.MsSql2008Dialect" overwrite="false"/>
4+
<property name="nhibernate.command_timeout" value="444" overwrite="false"/>
45
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" overwrite="false"/>
56
<property name="nhibernate.connection.connection_string" value="Server=.\SQLExpress;initial catalog=nhibernate;Integrated Security=SSPI" overwrite="false"/>
67
</project>
452 KB
Binary file not shown.
Binary file not shown.
151 KB
Binary file not shown.
78.8 KB
Binary file not shown.
887 KB
Binary file not shown.
530 KB
Binary file not shown.

lib/teamcity/sqlServerCe/NHibernate.Test.last-results.xml

Lines changed: 21629 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
341 KB
Binary file not shown.
86.3 KB
Binary file not shown.
150 KB
Binary file not shown.
65.3 KB
Binary file not shown.
627 KB
Binary file not shown.
378 KB
Binary file not shown.

src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@
7373
<RequiredTargetFramework>3.5</RequiredTargetFramework>
7474
</Reference>
7575
<Reference Include="System.Data" />
76+
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
77+
<SpecificVersion>False</SpecificVersion>
78+
<HintPath>..\..\lib\teamcity\sqlServerCe\System.Data.SqlServerCe.dll</HintPath>
79+
<Private>True</Private>
80+
</Reference>
7681
</ItemGroup>
7782
<ItemGroup>
7883
<Compile Include="TestDatabaseSetup.cs" />

src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<property name="sign" value="false" />
1111
<copy file="${root.dir}/lib/teamcity/firebird/FirebirdSql.Data.FirebirdClient.dll" todir="${bin.dir}" />
1212
<copy file="${root.dir}/lib/teamcity/postgresql/Npgsql.dll" todir="${bin.dir}" />
13+
<copy file="${root.dir}/lib/teamcity/sqlServerCe/System.Data.SqlServerCe.dll" todir="${bin.dir}" />
1314
<assemblyfileset id="project.references" basedir="${bin.dir}">
1415
<include name="mscorlib.dll" />
1516
<include name="System.dll" />
@@ -19,6 +20,7 @@
1920
<include name="NHibernate.Test.dll" />
2021
<include name="nunit.framework.dll" />
2122
<include name="FirebirdSql.Data.FirebirdClient.dll" />
23+
<include name="System.Data.SqlServerCe.dll" />
2224
<include name="Npgsql.dll" />
2325
</assemblyfileset>
2426
</target>

src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Data.Odbc;
44
using System.Data.SqlClient;
5+
using System.Data.SqlServerCe;
56
using System.IO;
67
using FirebirdSql.Data.FirebirdClient;
78
using NHibernate.Test;
@@ -24,7 +25,8 @@ public class DatabaseSetup
2425
{"NHibernate.Driver.OracleDataClientDriver", SetupOracle},
2526
{"NHibernate.Driver.MySqlDataDriver", SetupMySql},
2627
{"NHibernate.Driver.OracleClientDriver", SetupOracle},
27-
{"NHibernate.Driver.OracleManagedDataClientDriver", SetupOracle}
28+
{"NHibernate.Driver.OracleManagedDataClientDriver", SetupOracle},
29+
{"NHibernate.Driver.SqlServerCeDriver", SetupSqlServerCe}
2830
};
2931

3032
private static void SetupMySql(Cfg.Configuration obj)
@@ -113,6 +115,24 @@ private static void SetupFirebird(Cfg.Configuration cfg)
113115
FbConnection.CreateDatabase("Database=NHibernate.fdb;ServerType=1");
114116
}
115117

118+
private static void SetupSqlServerCe(Cfg.Configuration cfg)
119+
{
120+
try
121+
{
122+
if (File.Exists("NHibernate.sdf"))
123+
File.Delete("NHibernate.sdf");
124+
}
125+
catch (Exception e)
126+
{
127+
Console.WriteLine(e);
128+
}
129+
130+
using (var en = new SqlCeEngine("DataSource=\"NHibernate.sdf\""))
131+
{
132+
en.CreateDatabase();
133+
}
134+
}
135+
116136
private static void SetupNpgsql(Cfg.Configuration cfg)
117137
{
118138
var connStr = cfg.Properties[Cfg.Environment.ConnectionString];

src/NHibernate/Cfg/Configuration.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ public class Configuration : ISerializable
8080

8181
protected internal SettingsFactory settingsFactory;
8282

83-
private static readonly XmlSerializer mappingDocumentSerializer = new XmlSerializer(typeof(HbmMapping));
84-
8583
#region ISerializable Members
8684
public Configuration(SerializationInfo info, StreamingContext context)
8785
{
@@ -1810,7 +1808,7 @@ public NamedXmlDocument LoadMappingDocument(XmlReader hbmReader, string name)
18101808
{
18111809
var hbmDocument = new XmlDocument();
18121810
hbmDocument.Load(reader);
1813-
return new NamedXmlDocument(name, hbmDocument, mappingDocumentSerializer);
1811+
return new NamedXmlDocument(name, hbmDocument);
18141812
}
18151813
catch (MappingException)
18161814
{

src/NHibernate/Cfg/NamedXmlDocument.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ namespace NHibernate.Cfg
88
{
99
public class NamedXmlDocument
1010
{
11+
private static readonly XmlSerializer mappingDocumentSerializer = new XmlSerializer(typeof (HbmMapping));
1112
private readonly string name;
1213
private readonly HbmMapping document;
1314

14-
public NamedXmlDocument(string name, XmlDocument document, XmlSerializer mappingDocumentSerializer)
15+
static NamedXmlDocument() { }
16+
17+
public NamedXmlDocument(string name, XmlDocument document)
18+
: this(name, document, mappingDocumentSerializer)
19+
{
20+
}
21+
22+
public NamedXmlDocument(string name, XmlDocument document, XmlSerializer serializer)
1523
{
1624
if (document == null)
1725
{
@@ -24,7 +32,7 @@ public NamedXmlDocument(string name, XmlDocument document, XmlSerializer mapping
2432
}
2533
using (var reader = new StringReader(document.DocumentElement.OuterXml))
2634
{
27-
this.document = (HbmMapping)mappingDocumentSerializer.Deserialize(reader);
35+
this.document = (HbmMapping)serializer.Deserialize(reader);
2836
}
2937
}
3038

src/NHibernate/Impl/AbstractSessionImpl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ public virtual IQueryTranslator[] GetQueries(string query, bool scalar)
260260
public abstract string GuessEntityName(object entity);
261261
public abstract IDbConnection Connection { get; }
262262
public abstract int ExecuteNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters);
263-
public abstract FutureCriteriaBatch FutureCriteriaBatch { get; internal set; }
264-
public abstract FutureQueryBatch FutureQueryBatch { get; internal set; }
263+
public abstract FutureCriteriaBatch FutureCriteriaBatch { get; protected internal set; }
264+
public abstract FutureQueryBatch FutureQueryBatch { get; protected internal set; }
265265

266266
public virtual IQuery GetNamedQuery(string queryName)
267267
{

src/NHibernate/Impl/SessionImpl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public override FutureCriteriaBatch FutureCriteriaBatch
290290
futureCriteriaBatch = new FutureCriteriaBatch(this);
291291
return futureCriteriaBatch;
292292
}
293-
internal set
293+
protected internal set
294294
{
295295
futureCriteriaBatch = value;
296296
}
@@ -304,7 +304,7 @@ public override FutureQueryBatch FutureQueryBatch
304304
futureQueryBatch = new FutureQueryBatch(this);
305305
return futureQueryBatch;
306306
}
307-
internal set
307+
protected internal set
308308
{
309309
futureQueryBatch = value;
310310
}

src/NHibernate/Impl/StatelessSessionImpl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,13 +942,13 @@ public override int ExecuteUpdate(IQueryExpression queryExpression, QueryParamet
942942
public override FutureCriteriaBatch FutureCriteriaBatch
943943
{
944944
get { throw new System.NotSupportedException("future queries are not supported for stateless session"); }
945-
internal set { throw new System.NotSupportedException("future queries are not supported for stateless session"); }
945+
protected internal set { throw new System.NotSupportedException("future queries are not supported for stateless session"); }
946946
}
947947

948948
public override FutureQueryBatch FutureQueryBatch
949949
{
950950
get { throw new System.NotSupportedException("future queries are not supported for stateless session"); }
951-
internal set { throw new System.NotSupportedException("future queries are not supported for stateless session"); }
951+
protected internal set { throw new System.NotSupportedException("future queries are not supported for stateless session"); }
952952
}
953953

954954
public override IEntityPersister GetEntityPersister(string entityName, object obj)

teamcity.build

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,34 @@
4242
<property name="teamcity.last.result" value="${root.dir}/lib/teamcity/sqlServerOdbc/NHibernate.Test.last-results.xml" />
4343
</target>
4444

45+
<target name="setup-teamcity-sqlServerCe32">
46+
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SqlServerCeDriver" />
47+
<property name="nhibernate.dialect" value="NHibernate.Dialect.MsSqlCe40Dialect" />
48+
<property name="nhibernate.connection.connection_string" value="Data Source=NHibernate.sdf" />
49+
<property name="nhibernate.command_timeout" value="0" />
50+
<property name="NHibernate.Test.IgnoreFail" value="true" />
51+
<property name="teamcity.last.result" value="${root.dir}/lib/teamcity/sqlServerCe/NHibernate.Test.last-results.xml" />
52+
<copy todir="${bin.dir}">
53+
<fileset basedir="${root.dir}/lib/teamcity/sqlServerCe/X86">
54+
<include name="*.dll"/>
55+
</fileset>
56+
</copy>
57+
</target>
58+
59+
<target name="setup-teamcity-sqlServerCe64">
60+
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SqlServerCeDriver" />
61+
<property name="nhibernate.dialect" value="NHibernate.Dialect.MsSqlCe40Dialect" />
62+
<property name="nhibernate.connection.connection_string" value="Data Source=NHibernate.sdf" />
63+
<property name="nhibernate.command_timeout" value="0" />
64+
<property name="NHibernate.Test.IgnoreFail" value="true" />
65+
<property name="teamcity.last.result" value="${root.dir}/lib/teamcity/sqlServerCe/NHibernate.Test.last-results.xml" />
66+
<copy todir="${bin.dir}">
67+
<fileset basedir="${root.dir}/lib/teamcity/sqlServerCe/AMD64">
68+
<include name="*.dll"/>
69+
</fileset>
70+
</copy>
71+
</target>
72+
4573
<target name="setup-teamcity-firebird32">
4674
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.FirebirdClientDriver" />
4775
<property name="nhibernate.dialect" value="NHibernate.Dialect.FirebirdDialect" />

0 commit comments

Comments
 (0)