We have two databases oracle and and sql server. We use Nhibernate  as
ORM for these data bases.

Part of businees process we need to upadte the data in both oracle and
sql server databases as part of one transaction.

The transaction is created in the business layer. Business layer calls
both updates(oracle and sql server) using Nhibernate session.

Does Nhibernate use the transaction created in Business layer or it
starts a new transaction.when updating the records.

here is the sample code.

using (TransactionScope scope = new TransactionScope())
            {
                //NHibernateSessionFactory connecting to Oracle
database
                OracleNhibernateSessionfactory.GetCurrentSession
().SaveOrUpdate(obj);
                //NHibernateSessionFactory connecting to SQL Server
database
                SqlServerNhibernateSessionFactory.GetCurrentSession
().Saveorupdate(obj);
                scope.Complete();
            }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to