My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 30 days

  • Dec 14, 2009
    issue 17 (Change app storage to use HttpRuntime.Cache instead of HttpC...) reported by mayfieldstrategy   -   I ran into an issue using the AppStorage feature of NCommon in an ASP.NET environment. The problem with this is that AppStorage depends on HttpContext.Current existing when running under ASP.NET. HttpContext.Current will often be null when executing multi-threaded code within a web application. I propose using HttpRuntime.Cache instead of HttpContext.Application as the store backing. You can add things to the cache with a priority of NotRemovable to prevent the item from automatically expiring.
    I ran into an issue using the AppStorage feature of NCommon in an ASP.NET environment. The problem with this is that AppStorage depends on HttpContext.Current existing when running under ASP.NET. HttpContext.Current will often be null when executing multi-threaded code within a web application. I propose using HttpRuntime.Cache instead of HttpContext.Application as the store backing. You can add things to the cache with a priority of NotRemovable to prevent the item from automatically expiring.
  • Nov 30, 2009
    issue 16 (How To Setup "Per-call"/"OneTime" UnitOfWork using NCommon?) reported by achugh00   -   In an ASP.NET Web Application I am using L2S with NCommon v1.0 for now. I wanted to setup the UnitOfWorkScope at a request level i.e. start a new UnitOfWork as part of the Application_BeginRequest() method so that I can build upon the query as needed in my DAL but the query can be refined by the web page like applying filters, pagination, order by clauses etc. in the ASP.NET web page. The problem I am running into using the above approach is that whenever I try to execute (run) more than ONE (1) query I get the following error "Setting load options is not allowed after results have been returned from a query." The above error happens at the following line of code protected override IQueryable<TEntity> RepositoryQuery { get { DataContext.LoadOptions = _loadOptions; //*** ERROR HAPPENS HERE return Table; } } On the other hand if I create a UnitOfWorkScope inside my DAL I did not run into any problem but then all the pagination, filtering, ordering etc needs to be done inside the DAL. This make the DAL with lot of repetive methods having various parameters for various unique needs. This confueses the DAL use and clutters stuff up. Instead I wanted to create C# 3.0 Extension method filters that can be applied anytime by the UI on the base query as needed. For this reason, I am creating my UOW Scope at the request level. Can somone suggest how can I clear the DataContext so that I do not run into the above error? Or suggest what is the recommended approach to using NCommon for the above scenario? Thanks. -Amit
    In an ASP.NET Web Application I am using L2S with NCommon v1.0 for now. I wanted to setup the UnitOfWorkScope at a request level i.e. start a new UnitOfWork as part of the Application_BeginRequest() method so that I can build upon the query as needed in my DAL but the query can be refined by the web page like applying filters, pagination, order by clauses etc. in the ASP.NET web page. The problem I am running into using the above approach is that whenever I try to execute (run) more than ONE (1) query I get the following error "Setting load options is not allowed after results have been returned from a query." The above error happens at the following line of code protected override IQueryable<TEntity> RepositoryQuery { get { DataContext.LoadOptions = _loadOptions; //*** ERROR HAPPENS HERE return Table; } } On the other hand if I create a UnitOfWorkScope inside my DAL I did not run into any problem but then all the pagination, filtering, ordering etc needs to be done inside the DAL. This make the DAL with lot of repetive methods having various parameters for various unique needs. This confueses the DAL use and clutters stuff up. Instead I wanted to create C# 3.0 Extension method filters that can be applied anytime by the UI on the base query as needed. For this reason, I am creating my UOW Scope at the request level. Can somone suggest how can I clear the DataContext so that I do not run into the above error? Or suggest what is the recommended approach to using NCommon for the above scenario? Thanks. -Amit

Earlier this year

  • Nov 28, 2009
    r31 (- Added tests for Db4o adapter for NCommon - Refactoring of ...) committed by rao.ritesh   -   - Added tests for Db4o adapter for NCommon - Refactoring of NHUnitOfWork and NHUnitOfWorkFactoryTests
    - Added tests for Db4o adapter for NCommon - Refactoring of NHUnitOfWork and NHUnitOfWorkFactoryTests
  • Nov 23, 2009
    r30 (- First commit of db4o implementation of NNCommon unit of wo...) committed by rao.ritesh   -   - First commit of db4o implementation of NNCommon unit of work and repository. [Not tested. May not work. Try at your own risk.] - Added libs for db4o
    - First commit of db4o implementation of NNCommon unit of work and repository. [Not tested. May not work. Try at your own risk.] - Added libs for db4o
  • Nov 23, 2009
    r29 (- Refactoring of NH NCommon implementation.) committed by rao.ritesh   -   - Refactoring of NH NCommon implementation.
    - Refactoring of NH NCommon implementation.
  • Nov 23, 2009
    issue 15 (Local storage support for WCF application) commented on by jhicks0300   -   Adding new patch to use the Extensions property of OperationContext instead of InstanceContext in the WcfInstanceContext
    Adding new patch to use the Extensions property of OperationContext instead of InstanceContext in the WcfInstanceContext
  • Nov 23, 2009
    issue 15 (Local storage support for WCF application) reported by jhicks0300   -   NCommon's local storage implementation does not work with WCF service applications hosted in IIS. The attached patch addresses this issue by storing local storage items in an InstanceContext extension. Also refactored the GetInternalHashtable method of LocalStorage to use context sensitive storage classes (WebInstanceContext, WcfInstanceContext, and ThreadStaticContext).
    NCommon's local storage implementation does not work with WCF service applications hosted in IIS. The attached patch addresses this issue by storing local storage items in an InstanceContext extension. Also refactored the GetInternalHashtable method of LocalStorage to use context sensitive storage classes (WebInstanceContext, WcfInstanceContext, and ThreadStaticContext).
  • Nov 17, 2009
    r28 (- Restructured tests for all L2S, EF and NH. Test data g...) committed by rao.ritesh   -   - Restructured tests for all L2S, EF and NH. Test data generation is now part of unit tests and it's no longer necessary to prime the test database for running tests. NOTE: For EF and L2S tests, use TestDB.sql file to generate the test database. For NH, update config file setting schemaExport to Create to have NHibernate generate the database for you. - Updated Castle and NH libraries. - NOTE: Final commit before move to Git and branch to net4.0
    - Restructured tests for all L2S, EF and NH. Test data generation is now part of unit tests and it's no longer necessary to prime the test database for running tests. NOTE: For EF and L2S tests, use TestDB.sql file to generate the test database. For NH, update config file setting schemaExport to Create to have NHibernate generate the database for you. - Updated Castle and NH libraries. - NOTE: Final commit before move to Git and branch to net4.0
  • Nov 16, 2009
    issue 14 (NCommon.NHibernate tests failing.) reported by rao.ritesh   -   NCommon.NHibernate tests are broken and failing due to out of date DBScript.sql file and use FluentNH.
    NCommon.NHibernate tests are broken and failing due to out of date DBScript.sql file and use FluentNH.
  • Nov 11, 2009
    issue 8 (Sample application demonstrating this cool framework?) commented on by dplaskon   -   I was actually in the same boat, when I happened upon this project: http://code.google.com/p/vip32/ Although it doesn't use ncommon directly, you'll notice their infastructure is almost identical. Until Rao adds a reference app, I'd recommend having a look at this one.
    I was actually in the same boat, when I happened upon this project: http://code.google.com/p/vip32/ Although it doesn't use ncommon directly, you'll notice their infastructure is almost identical. Until Rao adds a reference app, I'd recommend having a look at this one.
  • Nov 08, 2009
    issue 13 (Mutiple Databases Support) reported by luiswu   -   Can you have demo code for supporting multiple databases, especially more than oen Entity Framework DataContext instance? This is helpful for larger scale project crossing databases. Thanks.
    Can you have demo code for supporting multiple databases, especially more than oen Entity Framework DataContext instance? This is helpful for larger scale project crossing databases. Thanks.
  • Oct 26, 2009
    r27 (- Added tests to NHRepositoryTests to verify delete works.) committed by rao.ritesh   -   - Added tests to NHRepositoryTests to verify delete works.
    - Added tests to NHRepositoryTests to verify delete works.
  • Oct 21, 2009
    issue 12 (Session Handling in WCF Application) reported by hannes.b...@hico.com   -   hello, i am using this cool framework in my application and the application should be available for a WCF client. So - i think - the behaviour should be that a new session is created for each request - analog go a web application. Which "Store" (NCommon.Storage) should i use for this scenario? "SessionStorage" seems not to be apropriate because there is no http- context in a WCF application. Should the "LocalStorage" be used in WCF applications? According to the description at http://igloocoder.com/archive/2008/07/21/nhibernate-on-wcf.aspx maybe it would be better to code another spceific "Store"? regards + thx for your help,
    hello, i am using this cool framework in my application and the application should be available for a WCF client. So - i think - the behaviour should be that a new session is created for each request - analog go a web application. Which "Store" (NCommon.Storage) should i use for this scenario? "SessionStorage" seems not to be apropriate because there is no http- context in a WCF application. Should the "LocalStorage" be used in WCF applications? According to the description at http://igloocoder.com/archive/2008/07/21/nhibernate-on-wcf.aspx maybe it would be better to code another spceific "Store"? regards + thx for your help,
  • Oct 13, 2009
    issue 11 (DB data type conflict for LTS when DB schema created by NH) commented on by rohancragg   -   Note: This Issue has a dependency on my suggested resolution to Issue#10 - i.e. I am assuming that to reproduce this you have to correct the TestDB.sql script following the steps as described in Issue#10. I am also aware that an alternative resolution to the ones I've outline above is that we could alter the NHibernate mappings or change the Type of the property (i.e. NCommon.Data.NHibernate.Tests.Domain.OrderItem.Price) from float to System.Decimal, which may still be a breaking change.
    Note: This Issue has a dependency on my suggested resolution to Issue#10 - i.e. I am assuming that to reproduce this you have to correct the TestDB.sql script following the steps as described in Issue#10. I am also aware that an alternative resolution to the ones I've outline above is that we could alter the NHibernate mappings or change the Type of the property (i.e. NCommon.Data.NHibernate.Tests.Domain.OrderItem.Price) from float to System.Decimal, which may still be a breaking change.
  • Oct 13, 2009
    issue 11 (DB data type conflict for LTS when DB schema created by NH) commented on by rohancragg   -   I have found that a work-around to get tests in NCommon.Data.EntityFramework.Tests to pass is: 1. Open TestModel.edmx and change Type for OrderItem.Price from 'Decimal' to 'Single'. 2. ModelExtmds.cs and make change to line 10: - get { return Price*Quantity;} + get { return Convert.ToDecimal(Price)*Quantity;} I'm sure this is not good but it gets the test all passing.
    I have found that a work-around to get tests in NCommon.Data.EntityFramework.Tests to pass is: 1. Open TestModel.edmx and change Type for OrderItem.Price from 'Decimal' to 'Single'. 2. ModelExtmds.cs and make change to line 10: - get { return Price*Quantity;} + get { return Convert.ToDecimal(Price)*Quantity;} I'm sure this is not good but it gets the test all passing.
  • Oct 13, 2009
    issue 11 (DB data type conflict for LTS when DB schema created by NH) commented on by rohancragg   -   Same steps to reproduce also cause a similar issue with EF: Error 2019: Member Mapping specified is not valid. The type 'Edm.Decimal[Nullable=False,DefaultValue=,Precision=,Scale=]' of member 'Price' in type 'NCommon.Data.EntityFramework.Tests.Domain.OrderItem' is not compatible with 'SqlServer.real[Nullable=True,DefaultValue=]' of member 'Price' in type 'NCommon.Data.EntityFramework.Tests.Domain.Store.OrderItems'. C:\src\ncommon\NCommon.EntityFramework\tests\Domain\TestModel.edmx
    Same steps to reproduce also cause a similar issue with EF: Error 2019: Member Mapping specified is not valid. The type 'Edm.Decimal[Nullable=False,DefaultValue=,Precision=,Scale=]' of member 'Price' in type 'NCommon.Data.EntityFramework.Tests.Domain.OrderItem' is not compatible with 'SqlServer.real[Nullable=True,DefaultValue=]' of member 'Price' in type 'NCommon.Data.EntityFramework.Tests.Domain.Store.OrderItems'. C:\src\ncommon\NCommon.EntityFramework\tests\Domain\TestModel.edmx
  • Oct 13, 2009
    issue 11 (DB data type conflict for LTS when DB schema created by NH) reported by rohancragg   -   What steps will reproduce the problem? 1. Create a Database in SQL Express 2008 with name as configured in App.config 2. Cause the DB schema to be created by a running any of the NHRepository tests at least once (what I did was write a mimimal query test that all customers returns zero records) and run that test on it's own to cause the schema update to happen. 3. Run query from contents of file /NCommon/TestDB.sql to set up all base Test data 4. Run all tests in NCommon.Data.LinqToSql.Tests @Revision26 Expected: all tests to pass Actual: all tests that call order.CalculateTotal() will fail (see details below) Resolution: open TestData.dbml and change System Data Type for OrderItem.Price from 'Decimal(18,1)' to 'real' NB: this gives the following warning which I chose to ignore: BML1008: Mapping between DbType 'real' and Type 'System.Decimal' in Column 'Price' of Type 'OrderItem' may cause data loss when loading from the database. --- LinqToSqlRepositoryTests.When_Calling_CalculateTotal_On_Order_Returns_Valid_When_Under_UnitOfWork : FailedSystem.InvalidCastException: Specified cast is not valid. at System.Data.SqlClient.SqlBuffer.get_Decimal() at System.Data.SqlClient.SqlDataReader.GetDecimal(Int32 i) at Read_OrderItem(ObjectMaterializer`1 ) at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext() at System.Data.Linq.EntitySet`1.Load() at System.Data.Linq.EntitySet`1.GetEnumerator() at NCommon.Extensions.CollectionExtensions.ForEach<T>(IEnumerable`1 collection, Action`1 action) in CollectionExtensions.cs: line 37 at NCommon.LinqToSql.Tests.Order.CalculateTotal() in TestDataClass.cs: line 10 at NCommon.Data.LinqToSql.Tests.LinqToSqlRepositoryTests.When_Calling_CalculateTotal_On_Order_Returns_Valid_When_Under_UnitOfWork() in LinqToSqlRepositoryTests.cs: line 367 --- LinqToSqlRepositoryTests.Repository_For_Uses_Registered_Fetching_Strategies : FailedSystem.InvalidCastException: Specified cast is not valid. at System.Data.SqlClient.SqlBuffer.get_Decimal() at System.Data.SqlClient.SqlDataReader.GetDecimal(Int32 i) at Read_Order(ObjectMaterializer`1 ) at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList<TSource>(IEnumerable`1 source) at NCommon.Data.LinqToSql.Tests.LinqToSqlRepositoryTests.Repository_For_Uses_Registered_Fetching_Strategies() in LinqToSqlRepositoryTests.cs: line 414
    What steps will reproduce the problem? 1. Create a Database in SQL Express 2008 with name as configured in App.config 2. Cause the DB schema to be created by a running any of the NHRepository tests at least once (what I did was write a mimimal query test that all customers returns zero records) and run that test on it's own to cause the schema update to happen. 3. Run query from contents of file /NCommon/TestDB.sql to set up all base Test data 4. Run all tests in NCommon.Data.LinqToSql.Tests @Revision26 Expected: all tests to pass Actual: all tests that call order.CalculateTotal() will fail (see details below) Resolution: open TestData.dbml and change System Data Type for OrderItem.Price from 'Decimal(18,1)' to 'real' NB: this gives the following warning which I chose to ignore: BML1008: Mapping between DbType 'real' and Type 'System.Decimal' in Column 'Price' of Type 'OrderItem' may cause data loss when loading from the database. --- LinqToSqlRepositoryTests.When_Calling_CalculateTotal_On_Order_Returns_Valid_When_Under_UnitOfWork : FailedSystem.InvalidCastException: Specified cast is not valid. at System.Data.SqlClient.SqlBuffer.get_Decimal() at System.Data.SqlClient.SqlDataReader.GetDecimal(Int32 i) at Read_OrderItem(ObjectMaterializer`1 ) at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext() at System.Data.Linq.EntitySet`1.Load() at System.Data.Linq.EntitySet`1.GetEnumerator() at NCommon.Extensions.CollectionExtensions.ForEach<T>(IEnumerable`1 collection, Action`1 action) in CollectionExtensions.cs: line 37 at NCommon.LinqToSql.Tests.Order.CalculateTotal() in TestDataClass.cs: line 10 at NCommon.Data.LinqToSql.Tests.LinqToSqlRepositoryTests.When_Calling_CalculateTotal_On_Order_Returns_Valid_When_Under_UnitOfWork() in LinqToSqlRepositoryTests.cs: line 367 --- LinqToSqlRepositoryTests.Repository_For_Uses_Registered_Fetching_Strategies : FailedSystem.InvalidCastException: Specified cast is not valid. at System.Data.SqlClient.SqlBuffer.get_Decimal() at System.Data.SqlClient.SqlDataReader.GetDecimal(Int32 i) at Read_Order(ObjectMaterializer`1 ) at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList<TSource>(IEnumerable`1 source) at NCommon.Data.LinqToSql.Tests.LinqToSqlRepositoryTests.Repository_For_Uses_Registered_Fetching_Strategies() in LinqToSqlRepositoryTests.cs: line 414
  • Oct 13, 2009
    issue 10 (Test DB script is out of date) commented on by rohancragg   -   Also, another change to an NH test is required to get all NH tests passing: NHRepositoryTests::testing_specification_with_sub_query() - .Where(order => order.OrderID == 1).FirstOrDefault(); + .Where(order => order.OrderID == 2).FirstOrDefault();
    Also, another change to an NH test is required to get all NH tests passing: NHRepositoryTests::testing_specification_with_sub_query() - .Where(order => order.OrderID == 1).FirstOrDefault(); + .Where(order => order.OrderID == 2).FirstOrDefault();
  • Oct 13, 2009
    issue 10 (Test DB script is out of date) reported by rohancragg   -   What steps will reproduce the problem? 1. Create a Database in SQL Express 2008 with name as configured in App.config 2. Run query from contents of file /NCommon/TestDB.sql 3. Open NCOmmon Everything.sln 4. Build solution 5. Run all unit tests Expected - all tests should pass Actual - some DB tests fail. Proposed resolution: 1. add line after line 52: > SET IDENTITY_INSERT [dbo].[Orders] OFF 2. Change all references to [Customers].[TotalSalesAmount] to [Amount] 2. Change all references to [Customers].[TotalSalesCurrency] to [Currency] p.s. I cannot seem to use TortoiseSVN to create a patch for this file as the MIME type is set to application/octet-stream... @Revision 26 running on VS2008 TS, Win Vista
    What steps will reproduce the problem? 1. Create a Database in SQL Express 2008 with name as configured in App.config 2. Run query from contents of file /NCommon/TestDB.sql 3. Open NCOmmon Everything.sln 4. Build solution 5. Run all unit tests Expected - all tests should pass Actual - some DB tests fail. Proposed resolution: 1. add line after line 52: > SET IDENTITY_INSERT [dbo].[Orders] OFF 2. Change all references to [Customers].[TotalSalesAmount] to [Amount] 2. Change all references to [Customers].[TotalSalesCurrency] to [Currency] p.s. I cannot seem to use TortoiseSVN to create a patch for this file as the MIME type is set to application/octet-stream... @Revision 26 running on VS2008 TS, Win Vista
  • Oct 13, 2009
    issue 8 (Sample application demonstrating this cool framework?) commented on by rohancragg   -   Hi Joost. If you look on Ritesh's blog under Rhinestone category you'll see that he is intending to use the Rhinestone app as a demonstration of NCommon. At the moment the Rhinestone source is sadly a bit out of sync with NCommon at the moment; although it references an NCommon.dll it was last updated in Feb 2009 but NCommon has had quite a few interesting features added since then. I checked-out the source for both and have added a more recent reference for NCommon into Rhinestone and it complies OK, but I still need to try out using the new features in NCommon such as Domain Events etc. Perhaps you can try the same while we wait for Ritesh to bring these a bit more into sync? Regards, Rohan.
    Hi Joost. If you look on Ritesh's blog under Rhinestone category you'll see that he is intending to use the Rhinestone app as a demonstration of NCommon. At the moment the Rhinestone source is sadly a bit out of sync with NCommon at the moment; although it references an NCommon.dll it was last updated in Feb 2009 but NCommon has had quite a few interesting features added since then. I checked-out the source for both and have added a more recent reference for NCommon into Rhinestone and it complies OK, but I still need to try out using the new features in NCommon such as Domain Events etc. Perhaps you can try the same while we wait for Ritesh to bring these a bit more into sync? Regards, Rohan.
  • Sep 30, 2009
    issue 9 (ValidationError.cs Guard checking will always be valid.) reported by jthope   -   Lines 37 and 39 contain: string.IsNullOrEmpty("message") string.IsNullOrEmpty("property") Should be: string.IsNullOrEmpty(message) string.IsNullOrEmpty(property)
    Lines 37 and 39 contain: string.IsNullOrEmpty("message") string.IsNullOrEmpty("property") Should be: string.IsNullOrEmpty(message) string.IsNullOrEmpty(property)
  • Sep 29, 2009
    r26 (- Updated Linq to Sql domain. - Removed redundant test speci...) committed by rao.ritesh   -   - Updated Linq to Sql domain. - Removed redundant test specification based tests for NHibernate. - Moved the TestData data context from Domain folder to the root folder.
    - Updated Linq to Sql domain. - Removed redundant test specification based tests for NHibernate. - Moved the TestData data context from Domain folder to the root folder.
  • Sep 29, 2009
    r25 (- Changed ValidationError fields to properties. Changed it t...) committed by rao.ritesh   -   - Changed ValidationError fields to properties. Changed it to a class.
    - Changed ValidationError fields to properties. Changed it to a class.
  • Sep 29, 2009
    r24 (* - Fixed spelling mistake for TransactionCommitted event in...) committed by rao.ritesh   -   * - Fixed spelling mistake for TransactionCommitted event in ITransaction - Updated Linq To Sql tests - Added tests for NHRepositoryTests to verify deletes - Added new test fixture when_quering_with_specification to test NH queries when using Specifications Signed-off-by: Ritesh Rao <rao.ritesh@gmail.com>
    * - Fixed spelling mistake for TransactionCommitted event in ITransaction - Updated Linq To Sql tests - Added tests for NHRepositoryTests to verify deletes - Added new test fixture when_quering_with_specification to test NH queries when using Specifications Signed-off-by: Ritesh Rao <rao.ritesh@gmail.com>
  • Sep 22, 2009
    issue 8 (Sample application demonstrating this cool framework?) reported by jo...@1-2dance.nl   -   Hi Rao, I don't have any issue to report in the framework. Instead I think it looks realy good! Its more like an idea I have. Do you by any chance have a sample application (in asp.net mvc for example) that could demonstrate the several features in the framework. (another idea would be to take an existing sample application and let it run on your framework.... would be nice for comparisand too) :) I know ncommon is covered by tests but a more real-worl example could make this framework easier to learn and adopt. Please let me know your thoughts on this? Greetings, Joost Verdaasdonk
    Hi Rao, I don't have any issue to report in the framework. Instead I think it looks realy good! Its more like an idea I have. Do you by any chance have a sample application (in asp.net mvc for example) that could demonstrate the several features in the framework. (another idea would be to take an existing sample application and let it run on your framework.... would be nice for comparisand too) :) I know ncommon is covered by tests but a more real-worl example could make this framework easier to learn and adopt. Please let me know your thoughts on this? Greetings, Joost Verdaasdonk
  • Sep 21, 2009
    issue 7 (Signing Off Again and Typo in Event Name) Status changed by rao.ritesh   -   Fixed in rev 23.
    Status: Fixed
    Fixed in rev 23.
    Status: Fixed
  • Sep 21, 2009
    r23 (- Spelling mistake fix for TransactionCommitted [http://code...) committed by rao.ritesh   -   - Spelling mistake fix for TransactionCommitted [http://code.google.com/p/ncommon/issues/detail?id=7]
    - Spelling mistake fix for TransactionCommitted [http://code.google.com/p/ncommon/issues/detail?id=7]
  • Sep 21, 2009
    issue 6 (bug in nested scope with CreateNew option) changed by rao.ritesh   -   Fixed in rev 22
    Status: Fixed
    Owner: rao.ritesh
    Fixed in rev 22
    Status: Fixed
    Owner: rao.ritesh
  • Sep 21, 2009
    r22 ([No log message]) committed by rao.ritesh   -   [No log message]
    [No log message]
  • Sep 21, 2009
    r21 (- Updated NCommon.LinqToSql.Tests.) committed by rao.ritesh   -   - Updated NCommon.LinqToSql.Tests.
    - Updated NCommon.LinqToSql.Tests.
  • Sep 21, 2009
    r20 (- Updated libs: NHibernate 2.1 NHibernate.Linq ...) committed by rao.ritesh   -   - Updated libs: NHibernate 2.1 NHibernate.Linq Castle NUnit 2.5.2 - Removed old xml mappings and switched to FluentNHibernate mappings in NCommon.NHibernate.Tests - Added tests to replicate issue 6 [google code: http://code.google.com/p/ncommon/issues/detail?id=6] - Updated EF model. - NCommon.LinqToSql.Tests is unloaded as model is not working. - Needs fixing.
    - Updated libs: NHibernate 2.1 NHibernate.Linq Castle NUnit 2.5.2 - Removed old xml mappings and switched to FluentNHibernate mappings in NCommon.NHibernate.Tests - Added tests to replicate issue 6 [google code: http://code.google.com/p/ncommon/issues/detail?id=6] - Updated EF model. - NCommon.LinqToSql.Tests is unloaded as model is not working. - Needs fixing.
  • Sep 16, 2009
    r19 ([No log message]) committed by rao.ritesh   -   [No log message]
    [No log message]
  • Sep 10, 2009
    r18 (- Modified default batch size in NHRepository to -1, to allo...) committed by rao.ritesh   -   - Modified default batch size in NHRepository to -1, to allow setting batch size back to 0. - Added test for replicating issue http://code.google.com/p/ncommon/issues/detail?id=6. Cannot replicate.
    - Modified default batch size in NHRepository to -1, to allow setting batch size back to 0. - Added test for replicating issue http://code.google.com/p/ncommon/issues/detail?id=6. Cannot replicate.
  • Aug 10, 2009
    issue 5 (Commit without Save still updates database) commented on by pablo.ruiz   -   Btw, I think I see what caused this issue.. There seems to be some sort of abiguity between Add/Save and Attach methods. An this is enfatished even worst on NHibernate case, in which "IRepository.Save()" does in fact calls Session.SaveOrUpdate.. I think it was calling just "Update" in the past.. ¿Why such a change?
    Btw, I think I see what caused this issue.. There seems to be some sort of abiguity between Add/Save and Attach methods. An this is enfatished even worst on NHibernate case, in which "IRepository.Save()" does in fact calls Session.SaveOrUpdate.. I think it was calling just "Update" in the past.. ¿Why such a change?
  • Aug 10, 2009
    issue 7 (Signing Off Again and Typo in Event Name) reported by do...@qixsoft.co.uk   -   The signing of the assemblies has been missed off again and there is a typo in the ITransaction interface for the event TransactonComitted instead of TransactionCommitted. This would be a breaking change but easily dealt with by ReSharper. Here is a patch file for these changes if you want it. Thanks for upgrading to NH2.1 and NH.Linq 1.0 too - saved me a job today :- ) Cheers Dokie
    The signing of the assemblies has been missed off again and there is a typo in the ITransaction interface for the event TransactonComitted instead of TransactionCommitted. This would be a breaking change but easily dealt with by ReSharper. Here is a patch file for these changes if you want it. Thanks for upgrading to NH2.1 and NH.Linq 1.0 too - saved me a job today :- ) Cheers Dokie
  • Aug 08, 2009
    issue 3 (UnitOfWork Action Filter) Status changed by rao.ritesh   -   I'm hesitant adding this to NCommon core because of the dependency to ASP.Net MVC. I may move this to a NCommon.Web library with some ASP.Net MVC specific helpers and utilities. Changing status to Accepted.
    Status: Accepted
    I'm hesitant adding this to NCommon core because of the dependency to ASP.Net MVC. I may move this to a NCommon.Web library with some ASP.Net MVC specific helpers and utilities. Changing status to Accepted.
    Status: Accepted
  • Aug 08, 2009
    issue 2 (Entity Framework ObjectContext Lifetime Management) changed by rao.ritesh   -   Changed to Enhancement. Closing ticket.
    Status: WontFix
    Labels: Type-Enhancement Type-Defect
    Changed to Enhancement. Closing ticket.
    Status: WontFix
    Labels: Type-Enhancement Type-Defect
  • Aug 08, 2009
    issue 3 (UnitOfWork Action Filter) Labels changed by rao.ritesh   -   Changed to Enhancement.
    Labels: Type-Enhancement Type-Defect
    Changed to Enhancement.
    Labels: Type-Enhancement Type-Defect
  • Aug 08, 2009
    issue 4 (AppStorage.GetInternalHashtable locks wrong object) changed by rao.ritesh   -   Fixed in trunk [rev17]
    Status: Fixed
    Owner: rao.ritesh
    Cc: rao.ritesh
    Fixed in trunk [rev17]
    Status: Fixed
    Owner: rao.ritesh
    Cc: rao.ritesh
  • Aug 08, 2009
    r17 (- Updated to NHibernate libs to 2.1 - Updated to NHibernate....) committed by rao.ritesh   -   - Updated to NHibernate libs to 2.1 - Updated to NHibernate.Linq 1.0 - Fixed issue: 4 [http://code.google.com/p/ncommon/issues/detail?id=4]
    - Updated to NHibernate libs to 2.1 - Updated to NHibernate.Linq 1.0 - Fixed issue: 4 [http://code.google.com/p/ncommon/issues/detail?id=4]
  • Aug 08, 2009
    issue 5 (Commit without Save still updates database) Status changed by rao.ritesh   -   Closing this issue.
    Status: Done
    Closing this issue.
    Status: Done
  • Aug 03, 2009
    issue 6 (bug in nested scope with CreateNew option) reported by applicat...@mlmbydesign.com   -   What steps will reproduce the problem? using (UnitOfWorkScope masterScope = new UnitOfWorkScope()) { using (UnitOfWorkScope nestedScope = new UnitOfWorkScope(UnitOfWorkScopeTransactionOptions.CreateNew)) { MyEntity e = readEntity(); e.SomeField = "some new value"; saveEntity(e); nestedScope.Commit(); } masterScope.Dispose(); // this is not really needed, it's here for illustration of rollback MyEntity entityAfterRollback = readEntity(); // the assert will fail Assert.AreEqual(entityAfterRollback.SomeField, "some new value"); } public MyEntity readEntity() { using (UnitOfWorkScope scope = new UnitOfWorkScope()) { // read your entity here scope.Commit(); // return the entity } } public MyEntity saveEntity(MyEntity theEntity) { using (UnitOfWorkScope scope = new UnitOfWorkScope()) { // save your entity here scope.Commit(); // return the entity } } What is the expected output? What do you see instead? I would expect the changes made in the nestedScope to have been committed, even though the masterScope has been rolled back. What version of the product are you using? On what operating system? Please provide any additional information below. After some investigation, I figured out that the calls from inside the nestedScope attach themselves to the wrong scope, to the masterScope, instead of attaching themselves to the nestedScope as I expected. I think this is controlled in the UnitOfWorkScopeTransaction.GetTransactionForScope(). When this method searches for compatible transactions in the CurrentTransactions prop, it returns the first one available, which is the root in the collection (masterScope). Maybe the CurrentTransactions prop should be implemented as a stack? But even if that's changed, the GetTransactionForScope() method should only reuse the transaction from the top of the stack, no?
    What steps will reproduce the problem? using (UnitOfWorkScope masterScope = new UnitOfWorkScope()) { using (UnitOfWorkScope nestedScope = new UnitOfWorkScope(UnitOfWorkScopeTransactionOptions.CreateNew)) { MyEntity e = readEntity(); e.SomeField = "some new value"; saveEntity(e); nestedScope.Commit(); } masterScope.Dispose(); // this is not really needed, it's here for illustration of rollback MyEntity entityAfterRollback = readEntity(); // the assert will fail Assert.AreEqual(entityAfterRollback.SomeField, "some new value"); } public MyEntity readEntity() { using (UnitOfWorkScope scope = new UnitOfWorkScope()) { // read your entity here scope.Commit(); // return the entity } } public MyEntity saveEntity(MyEntity theEntity) { using (UnitOfWorkScope scope = new UnitOfWorkScope()) { // save your entity here scope.Commit(); // return the entity } } What is the expected output? What do you see instead? I would expect the changes made in the nestedScope to have been committed, even though the masterScope has been rolled back. What version of the product are you using? On what operating system? Please provide any additional information below. After some investigation, I figured out that the calls from inside the nestedScope attach themselves to the wrong scope, to the masterScope, instead of attaching themselves to the nestedScope as I expected. I think this is controlled in the UnitOfWorkScopeTransaction.GetTransactionForScope(). When this method searches for compatible transactions in the CurrentTransactions prop, it returns the first one available, which is the root in the collection (masterScope). Maybe the CurrentTransactions prop should be implemented as a stack? But even if that's changed, the GetTransactionForScope() method should only reuse the transaction from the top of the stack, no?
  • Jul 20, 2009
    issue 3 (UnitOfWork Action Filter) commented on by elado7   -   Or even: public class UnitOfWorkTransactionAttribute : FilterAttribute,IResultFilter { private readonly UnitOfWorkScope _scope=new UnitOfWorkScope(); public void OnResultExecuting(ResultExecutingContext filterContext) { } public void OnResultExecuted(ResultExecutedContext filterContext) { _scope.Commit(); _scope.Dispose(); } } To be able to have it on whole Controller and also on single action.
    Or even: public class UnitOfWorkTransactionAttribute : FilterAttribute,IResultFilter { private readonly UnitOfWorkScope _scope=new UnitOfWorkScope(); public void OnResultExecuting(ResultExecutingContext filterContext) { } public void OnResultExecuted(ResultExecutedContext filterContext) { _scope.Commit(); _scope.Dispose(); } } To be able to have it on whole Controller and also on single action.
  • Jul 19, 2009
    issue 3 (UnitOfWork Action Filter) commented on by elado7   -   I would change OnActionExecuted to OnResultExecuted, so I can have deferred loading instead of sending loaded lists (ToList()) as data to the view.
    I would change OnActionExecuted to OnResultExecuted, so I can have deferred loading instead of sending loaded lists (ToList()) as data to the view.
  • Jul 17, 2009
    issue 5 (Commit without Save still updates database) commented on by br...@vallelunga.com   -   Thanks for clearing that up for me. It certainly makes sense.
    Thanks for clearing that up for me. It certainly makes sense.
  • Jul 17, 2009
    issue 5 (Commit without Save still updates database) commented on by luiswu   -   If it's for Entity Framework/Linq2SQL, Save() is doing NOTHING as you look at source code EFRepository.cs. If it's for a new instance of customer,you will call customerRepository.Add(customer) and then Commit(). If an entity exists, Commit() will take care of everything as Entity Framework tracks the changes.
    If it's for Entity Framework/Linq2SQL, Save() is doing NOTHING as you look at source code EFRepository.cs. If it's for a new instance of customer,you will call customerRepository.Add(customer) and then Commit(). If an entity exists, Commit() will take care of everything as Entity Framework tracks the changes.
  • Jul 15, 2009
    issue 5 (Commit without Save still updates database) commented on by hannes.b...@gmx.at   -   > Shouldn't I have to call customerRepository.Save(customer) first? No. This is the way, OR-mappers behave. You need to call "Save()" to attach a new entity to the session, so that it is stored, when you call "Commit()". If an entity exists, you can load it (your call to customerService.GetCustomer()) and the OR-mapper does change tracking automatically within the unit of Work. It then "knows" that you changed the 'FirstName' of your customer and when you call Commit() it sends an update command to the DB. Save() is only needed, when you want to create a new f.e. "Customer". Attention: Do not place your validation Code in the Save() command because the user does not need to call it, to persist changes.
    > Shouldn't I have to call customerRepository.Save(customer) first? No. This is the way, OR-mappers behave. You need to call "Save()" to attach a new entity to the session, so that it is stored, when you call "Commit()". If an entity exists, you can load it (your call to customerService.GetCustomer()) and the OR-mapper does change tracking automatically within the unit of Work. It then "knows" that you changed the 'FirstName' of your customer and when you call Commit() it sends an update command to the DB. Save() is only needed, when you want to create a new f.e. "Customer". Attention: Do not place your validation Code in the Save() command because the user does not need to call it, to persist changes.
  • Jul 14, 2009
    r16 (- Added support for SetBatchSize on repository. - Added ctor...) committed by rao.ritesh   -   - Added support for SetBatchSize on repository. - Added ctor overload to UnitOfWorkScope, to allow just specifying the transaction otions.
    - Added support for SetBatchSize on repository. - Added ctor overload to UnitOfWorkScope, to allow just specifying the transaction otions.
  • Jul 09, 2009
    issue 5 (Commit without Save still updates database) reported by br...@vallelunga.com   -   I have some code that looks like this: using (var scope = new UnitOfWorkScope()) { var customer = customerService.GetCustomer(); customer.FirstName = "Bob"; scope.Commit(); } I would expect the customer not to be saved, and yet this is exactly what is happening. This is using the EntityFramework and the 1.0 release of NCommon. Shouldn't I have to call customerRepository.Save(customer) first?
    I have some code that looks like this: using (var scope = new UnitOfWorkScope()) { var customer = customerService.GetCustomer(); customer.FirstName = "Bob"; scope.Commit(); } I would expect the customer not to be saved, and yet this is exactly what is happening. This is using the EntityFramework and the 1.0 release of NCommon. Shouldn't I have to call customerRepository.Save(customer) first?
  • Jun 30, 2009
    issue 3 (UnitOfWork Action Filter) commented on by luiswu   -   Here is my approach: using NCommon.Data; public class UnitTransactionAttribute : ActionFilterAttribute { private UnitOfWorkScope scope = new UnitOfWorkScope(); public override void OnActionExecuted(ActionExecutedContext filterContext) { scope.Commit(); scope.Dispose(); } } Now I can do this : ) [UnitTransaction] public ActionResult Index() { return View ( _repository.ToList()); }
    Here is my approach: using NCommon.Data; public class UnitTransactionAttribute : ActionFilterAttribute { private UnitOfWorkScope scope = new UnitOfWorkScope(); public override void OnActionExecuted(ActionExecutedContext filterContext) { scope.Commit(); scope.Dispose(); } } Now I can do this : ) [UnitTransaction] public ActionResult Index() { return View ( _repository.ToList()); }
 
Hosted by Google Code