Hi All,
Heres the problem, we have two SQL servers with "Linked Server" references between them. We have NHibernate able to pull data from these tables and even build the mapped bags, lists, sets by joining between the tables.
We achieved this by adding a fully qualified name to our table name i.e
Table "Categories" on server 1 has an hbm mapping:
Code:
<class name="Category" table="DBSVR1.Jeanie_Master.dbo.Category" select-before-update="false" optimistic-lock="none">
<!-- etc -->
</class>
All is going well, untill we have to persist an object. At the point NHibernate persists an object to SQL using auto increment of the identity field is calls ''select SCOPE_IDENTITY()' to get the last identity value provided by sql e.g.
Code:
INSERT INTO [DBSVR2].[Jeanie_Import].[dbo].ContentProviderImportLog (ContentProviderId, DateImported, IsSucessful) VALUES (1, GETDATE(), 1); select SCOPE_IDENTITY();
Thus we do not get the identity result back and NHibernate throws an exception. What can I do?
Cheers, Chris.