Speed ORM 1.2.2.0

This is an older release. Please see the latest click once release.
Rating: No reviews yet
Downloads: 11
Change Set: 27238
Released: Nov 7, 2013
Updated: Nov 7, 2013 by castefani
Dev status: Stable Help Icon

Release Notes

Support to concurrency

Support to concurrency is ready.

To test:

1 - Create a table

CREATE TABLE dbo.Customer(
CustomerId int IDENTITY(1,1) NOT NULL,
CustomerName varchar(100) NOT NULL,
CONSTRAINT PK_Customer PRIMARY KEY CLUSTERED
(
CustomerId ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY

2 - Insert 1 record:
Insert into Customer(CustomerId, CustomerName) values (1, 'Test');

3- Create a Console Program
- Add references: Speed.Common, Speed.Data and System.Runtime.Serialization
- Target ."NET Framework", not "NET Framework Client Profile"

4 - Execute this code in main method:
```
// ProviderType
Sys.ProviderType = EnumDbProviderType.SqlServer;
// Initialize ConnectionString
Sys.ConnectionString = "Data Source=localhost;Initial Catalog=SpeedTests;Integrated Security=True;MultipleActiveResultSets=True;";


// Open database
using (var db = Sys.NewDb())
{
// select 1 record - Second parameter (concurrency) must be true
var rec1 = db.SelectSingle<TestGen.SqlServer.Data.Customer>("CustomerId=1", true);
// change value to 'Teste 1'
rec1.CustomerName = "Test 1";
// Save and requery value
db.Save<TestGen.SqlServer.Data.Customer>(rec1, EnumSaveMode.Requery);
// Now in database, CustomerName ='Teste 1'

// make a copy
var rec2 = rec1.CloneT();

// change and save rec2
rec2.CustomerName = "Test 2";
db.Save<TestGen.SqlServer.Data.Customer>(rec2);
// Now in database, CustomerName ='Teste 2'

try
{
// save rec1 - Concurency Exception
db.Save<TestGen.SqlServer.Data.Customer>(rec1);
}
catch (DBConcurrencyException ex)
{
Console.WriteLine(ex.Message);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

```

Reviews for this release

No reviews yet for this release.