SynchronizationLockException when using DatabaseFactory

Topics: Data Access Application Block
Jun 2, 2010 at 1:43 AM

I'm calling


from a repository within a WCF service instance.

Whenever I call it, I get an error:

System.Threading.SynchronizationLockException occurred  Message="Object synchronization method was called from an unsynchronized block of code."  Source="Microsoft.Practices.Unity"  StackTrace:       at Microsoft.Practices.Unity.SynchronizedLifetimeManager.TryExit() in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\Lifetime\SynchronizedLifetimeManager.cs:line 109  InnerException: 


Why is this happening and how can I prevent it? 

Jun 2, 2010 at 2:13 AM
Edited Jun 2, 2010 at 2:14 AM

Hi stangogh, does this halt your program execution or only appears in the debugger?  You might be encountering this issue.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.