-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NHibernate, WCF and ValidationInterceptor
PostPosted: Wed Jul 04, 2007 4:43 am 
Newbie

Joined: Sat Jun 23, 2007 5:36 pm
Posts: 7
Hello all,

we have some problem with the combination of NHibernate, WCF and a ValidationInterceptor, and I can't find the cause of this. Hope one of you can help.

We are creating an application using a SOA architecture. The client is a web-client based on the WCSF (for now, more clients will probaply be added in the furure), the service layer are WCF services (creating using the WSSF) and the database is an oracle database.

The following is happening. When a call is being made from the client to the service layer, a new session is created and a transaction is started. The call is to save an entity. When calling the SaveOrUpdate method of the session, the validationinterceptor is being called and this validates the entity. This validationinterceptor is created using the Validation Application Block from the Enterprise Library. When the entity is validated and no errors are found, the entity is saved, a response is sent to the client, the transaction is committed and the session closed. This all works like a charm.
However, when the validation of the entity fails, the problems start. When the validation fails, we throw a custom exception. Next, the session is being closed (this always happens at the end of a service call). The exception is being handled at the client side. When a new call is started (and a new session is created with a new transaction) to get a list of some other entities, the validation of the invalid entity from the previous call is done again and fails again off course. I don't understand why this invalid entity from a different session is suddenly available in this new session. I've been looking at the new session object in debug mode and found that in this invalid entity was present in Session.SessionImpl.entityEntries.EntryList. However, I can't find how this is getting here in the new session and why.

I hope it's clear what the problem is. I can't understand why the invalid entity is present in the new session. I hope someone can point me in the direction where the invalid object is coming from and how to avoid this. This way, every time the validation fails, I have to restart the webdevelopmentserver of VS2005 of the service layer to be able to continue.

Hope someone can help. Thanks in advance,
Koen Willemse


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 6:09 am 
Newbie

Joined: Sat Jun 23, 2007 5:36 pm
Posts: 7
I've been trying also to clear the cache. I call the Clear method before closing every session. I also added the functionality to call Evict on the SessionFatory for the object that failed the validation. Unfortunately, this also didn't fix the problem. Anybody other ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.