aliozgur posted on September 22, 2008 12:07
During evolution of .NET related technologies (almost lasted a decade) Microsoft published bunch of experimental technologies, frameworks and packages which caused developers to feel a little bit confused. This confusion made developers feel uncomfortable about the future of these technologies and we simply preferred, to the extent we can survive, not to use new .NET related stuff. We had the feeling that we were fighting to find our way out of a huge dust cloud, I think even Microsoft felt a little bit exhausted and as a result was late to set a clear vision for all these technologies. But with the release of .NET framework 3.0 and 3.5 it seems that Microsoft managed to settle down a clear vision about the future of .NET development. I think next decade (by 2010) we will talk/hear about and develop software based on the following .NET related technologies.

Posted in: .NET Development  Tags:

Here is aother strange problem related with NHibernate

The Problem

I have a Parent class and two child classes Child1 and Child2 mapped to different tables on the database.
Lets assume that we specified cascade='all' for child bags defined on Parent.hbm.xml. Sample workflow of instantiating parent and child objects is as the following

- Create a parent object.
- Insert 2 Child1 instances to child1 bag
- Insert 3 Child2 instances to child2 bag.
- Flush the session
- Refresh parent object
- We get 6 instances for each child bag (child1 and child2). But we expect 2 Child1 instances in child1 bag and 3 Child2 instances in child2 bag.

Ther problem is : NHibernate performs left outer join on Child1 and Child2 tables when Refresh is called for the parent object. This is unaccaptable, I think NHibernate should initialize child collections with seperate selects commited to the database, or may be distinguish the duplicated child instances automatically in the collections. (using idbag instead of bag is not an option)

Download the test case

Requirements

Watch This


Posted in: .NET Development , C# , NHibernate  Tags:

I discovered this problem while developing a new system with the latest NHibernate.Burrow distribution (which in turn uses the latest NHibernate distribution).I spent some time Googling around to check if anyboy else met the same problem and found some entries but none of them specified exactly why this failure was happening and how we can solve this problem.
More...


Posted in: .NET Development , C# , NHibernate  Tags:
aliozgur posted on May 19, 2008 09:00

Evolution of new web technologies directed enterprises to web based software solutions. New tecnologies and frameworks offer lots features for web based solutions but entreprises still need some sort of rich client back office software to access backend data or perform specialized and complicated business tasks.

Pragma BackOffice (PragmaBO) is an effort to provide extensible rich client framework for enterprise level back office solutions based on Microsoft platform (Windows, .NET , C#, MS SQL Server 2005/Express ). Main features of PragmaBO are More...


Posted in: .NET Development , General Development  Tags:
aliozgur posted on April 23, 2008 09:29
As a former long standing Delphi developer (actually I am still maintaining some Delphi projects) I really love the Delphi IDE. Visual Studio is also a fantastic IDE with lots of productivity features. But I always missed "Numbered Bookmarks" of Delphi. This feature really saves time while navigating source code back and forward. Finally I found DPack addin which has Numbered Bookmarks and emulation of some GExperts for Delphi features. DPack is also a free addin, I would recommend this addin to former Delphi developers . You can get DPack from here.

Posted in: .NET Development  Tags:

For a while I am thinking about the Microsoft's support to open source projects. Some news that attracted my attention to this issue were

  • Foundation of CodePlex, open source project hosting web site of Microsoft
  • Ms-PL license developed by Microsoft  
  • Release of .NET Framework libraries  source code . Read more
  • Release of ASP .NET MVC source code. Read more

Heritage

Microsoft has developed very successfull technologies through history. COM/ActiveX formed a good baseline for MS platforms and related runtimes like MTS, COM+ and DCOM were a must for enterprise level application development targeted at MS platforms. VB was a fantastic programming language, even I've never written single line of VB code I remember how my co-workers rocked with VB, ASP was not perfect but it was, actually it still is, productive and easy to learn and VC++ powered with MFC was the programming language of choice for lower level software development. All these runtimes, frameworks and languages were not perfect, but they did succeeded in helping software developers to produce valuable software. However some of these technologies required software developers to have some sort of geek talent. For example it was very difficult for a regular software developer to write some sort of event sink COM code or programmatically configure the DCOM environment. I think Microsoft has learned more than we expected from the history I briefly tried to explain. Now we are at the age of .NET and related technologies and personally I expect less hesitation than the previous experiences we all ran through.
More...


Some PragmaSQL users were notifying me about a strange but deadly serious error caused after recovering from a server connection transport-level error. To reproduce the error follow these steps:

1- Open PragmaSQL Editor and choose a connection from Saved Connections list to connect. I will assume that Default Database of the selected connection is DatabaseA 

2- In the opened script editor change database to DatabaseB

3- Open to Microsoft Sql Server Management Studio and from Management node select Activity Monitor. Find the process for DatabaseB created by PragmaSQL application and kill that process.

4- Return to PragmaSQL editor and try to execute the select statement for the selected database, that is DatabaseB.

5- You will get transport-level error after trying to execute the statement for the first time.

6- Try to execute the statement again and this time you will succeed. But the statement was executed on the initial database, that is DatabaseA not in DatabaseB (selected one ). This error may cause very serious problems if you were trying to modify data you would simply modify the data in wrong database.

The problem is actually with database change code inside PragmaSQL which is not really a bug but misusage of SqlConnection class's ChangeDatabase method. While I was coding the change database logic I did not realy realised that ChangeDatabase method does not modify the Initial Catalog property of the ConnectionString, actually there is no way to modify the ConnectionString property of the SqlConnection object once it is opened. SqlConnection object in the script editor is created and opened only after the user changes the selected server, database changes does not cause a new SqlConnection object to be created and opened, we simply change the database property of the existing SqlConnection object and that is it. I did not considered SqlConnection object's error recovery scnearios (transport-level error for example) at all. The fact is that SqlConnection class recovers from transport-level error very well but uses the ConnectionString property to reopen the connection, no matter what was the database before the error SqlConnection object always restores connection to Initial Catalog property specified in the ConnectionString.

Very ugly bug, but I am happy to resolve that one. Upcoming 1.0.0.34 version will include solution for this issue.


Introduction

Cuyahoga provides module developers with a simple to use wrapper classes for full text indexing with Lucene.NET.
Although wrapper classes are easy to use these classes are not generic in nature. I mean
we, as module developers, have to convert our custom content (be it static or dynamic)
to a SearchContent object so that wrapper classes can index that content. Another similar limitation is when we perform search on the indexed content we can only get collection of SearchResult objects. I also want to mention that we, as module developers, have no control over which fields will be stored/unstored, which fields will be used as keywords or which fields will not be indexed while wrapper objects build the full text index.

In this article I will try to show you how we can make Cuyahoga.Core fulltext indexing capabilities more generic by providing a seperate extension assembly.
More...


Posted in: .NET Development , CodeProject , Cuyahoga , Lucene.NET  Tags:
aliozgur posted on February 18, 2008 14:24

Introduction

Cuyahoga framework has very nice approach to Web development. It has bunch of built-in modules and you can develop your own modules in a
couple of hours. If you have some experience with NHibernate and/or some other web framework your module development
may even take less than an hour. My product site PragmaSQL Online runs on top of Cuyahoga framework and it took
me just a couple of hours to bring this site up and running. Although Cuyahoga is a very nice framework and I love Cuyahoga development
I shall admit that you may experience some problems while applying some advanced topics like Ajax to Cuyahoga. In this article
I will show you a simple and structured way to add Ajax support to your Cuyahoga web site.
More...


Posted in: .NET Development , CodeProject , Cuyahoga , NHibernate  Tags:
aliozgur posted on February 6, 2008 14:28

Audit logging is an important issue while building enterprise systems. Simplest form of audit logging is recording
who and when created/updated an object, or a record in the database respectively. We perform four basic operations
on a domain object. These are

Load
Update
Save
Delete


Data access layer is a good place to perform automated audit logging
whenever one of the operations above is executed. NHibernate provides us with
IInterceptor interface plus ILifecylce interface. You can read this article for more
information about Nhibernate entity lifecyle management.

In this article we will try to perform simple logging that meets the
following minimal requirements

1- We will log who performed insert/update and when this operation was performed
2- Log data will be written to the same database and table as our domain object
More...


Posted in: .NET Development , CodeProject , NHibernate  Tags: