Re: [sharp-architecture] Fluent NHibernate with a single SQL Server DB Instance and multiple, load balanced web services inserting to same SQL Server table with auto-increment integer primary key

128 views
Skip to first unread message

Seif Attar

unread,
Aug 14, 2012, 4:57:05 PM8/14/12
to sharp-arc...@googlegroups.com
What is the error/exception you are getting?

Avoid using the identity generator if possible, you loose a lot of the
benefits of nhibernate with that.

Also avoid cross posting (saw this question on the nh dev list)

On 14 August 2012 21:43, Buddy Guy <buddyg...@gmail.com> wrote:
> Hi, is the architecture described in the subject valid? I appear to get conflicts when more than one instance of a web service is trying to do the inserts to tables based on auto-increment integer primary keys (in SQL Server).
>
> Thanks, bg.
>
> --
> You received this message because you are subscribed to the Google Groups "S#arp Architecture" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/sharp-architecture/-/Luy4n3Mubz0J.
> To post to this group, send email to sharp-arc...@googlegroups.com.
> To unsubscribe from this group, send email to sharp-architect...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sharp-architecture?hl=en.
>

Buddy Guy

unread,
Aug 14, 2012, 5:08:47 PM8/14/12
to sharp-arc...@googlegroups.com

On server #1:
Could not execute query: INSERT INTO (etc...); select SCOPE_IDENTITY()
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

On server #2:
Could not synchronize database state with session
NHibernate.StaleStateException: Batch update returned unexpected row count from update; actual row count: 0; expected: 1


Reply all
Reply to author
Forward
0 new messages