I also use NHibernate
A place to put all of my random thoughts about software development and computer programming.
Showing posts with label NHibernate. Show all posts
Showing posts with label NHibernate. Show all posts
February 4, 2009
Silverlight with ActiveMQ and NHibernate
I'm getting ready to start on a new application that I want to write using Silverlight
. Current I use ActiveMQ
as a messaging bus between applications and services. I would like to do the same for Silverlight, and avoid WCF
, so that I only have one service architecture to maintain. I have not seen much on using thewe to technologies together. The best I have found is a few messages about compiling NMS against a beta version of the Silverlight runtime. Appears that things almost work, and may work now. Has any one seen anything newer or something actually working?
I also use NHibernate
as an ORM solution. Same issue, trying to find people that have been able to sucessfully use these 2 technologies together. Once again, not a whole lot of reliable looking things. Some rumblings about LINQ, which seems to indicate that it would work. But nothing obvious.
I also use NHibernate
Labels:
ActiveMQ,
C#,
NHibernate,
Silverlight,
software development
January 28, 2009
NHibernate
Lately I've been working on a new data access layer. The new project is for some C# code that I work on, so we decided to use NHibernate
. I've been doing some research and playing with NHibernate. First thing is that the actual NHibernate site is not the best place to go for up to date documentation. I'm using NHibernate 2.0, but most of the documentation is specific to 1.0, and doesn't always work in 2.0. After some searching (more than was necessary, since I would expect something like this to be easy to find), I found another site: NHibernate Forge. It has content that is more updated, especially the main reference documenation.
So far everything seems to work pretty well. A few little things I have stumbled on:
NHibernate has great logging, but it can be overkill as times. I decided to limit the log4net appenders, so that the NHibernate logs didn't overwhelm the rest of the logging. Since I use multiple different apps that all use the same configuration for log4net, I setup the logging programatically, instead of trying to maintain identical logging config files for each. This can make it a little harder to set up loggers, but I stumbled on how to do this as well.
I was also trying to look into NHibernate transactions, and the possibility of nested transactions using savepoints. I use these in some of my other code to deal with certain error cases where some things need to be rolled back, but not an entire transaction. It seems that this doesn't really work well with NHibernate. Because of the tight coupling between the data objects in memory and the database, rolling back part of a transaction could leave the in memory objects in an inconsistent state. Fortunately in most cases this will be OK, but it is nice to be able to use the savepoints in some cases.
I think I've worked out most of the details for what I need, I'm just trying to create some lightweight wrappers around NHibernate, to give me an abstraction layer between NHibernate and my code. Hopefully everything will be smooth sailing from here on out.
So far everything seems to work pretty well. A few little things I have stumbled on:
NHibernate has great logging, but it can be overkill as times. I decided to limit the log4net appenders, so that the NHibernate logs didn't overwhelm the rest of the logging. Since I use multiple different apps that all use the same configuration for log4net, I setup the logging programatically, instead of trying to maintain identical logging config files for each. This can make it a little harder to set up loggers, but I stumbled on how to do this as well.
I was also trying to look into NHibernate transactions, and the possibility of nested transactions using savepoints. I use these in some of my other code to deal with certain error cases where some things need to be rolled back, but not an entire transaction. It seems that this doesn't really work well with NHibernate. Because of the tight coupling between the data objects in memory and the database, rolling back part of a transaction could leave the in memory objects in an inconsistent state. Fortunately in most cases this will be OK, but it is nice to be able to use the savepoints in some cases.
I think I've worked out most of the details for what I need, I'm just trying to create some lightweight wrappers around NHibernate, to give me an abstraction layer between NHibernate and my code. Hopefully everything will be smooth sailing from here on out.
Subscribe to:
Posts (Atom)