Entity Framework ConCurrent Issue

Hi Everyone,
I need to build an application that will have concurrent users access MS SQL records.  I'm using EF 4.3.1 and have an entity call "apps_SystemInfo and one of the properties is call "RowVersion" which of course is a "TimeStamp"
and is set to "Fixed" Concurrent Mode. I'm trying to simulate a scenario for a ConCurrent exception but for some reason it is not working.  What I notice is that the second entity statment(ctx1) is being is being save but not the first(ctx).
Therefore SMTPPort is being set to 6000 on the sql record.  I need to catch  the concurrent exception and alert the user.  Any help  would be greatly appreciated.
private void UpdateSystemInfo()
using (AllocationEntities ctx = new AllocationEntities())
var d = (from c in ctx.apps_SystemInfo.Where(p => p.ID == 1)
select c).FirstOrDefault();
d.SMTPPort = 8000;
using (AllocationEntities ctx1 = new AllocationEntities())
var u = (from c in ctx.apps_SystemInfo.Where(p => p.ID == 1)
select c).FirstOrDefault();
u.SMTPPort = 6000;
ctx1.SaveChanges();
MessageBox.Show("Update inner update");
try
{ //This should trigger a ConcurrentException
ctx.SaveChanges();
MessageBox.Show("System infomation has been updated successfully", "Result");
catch (OptimisticConcurrencyException oCE)
MessageBox.Show(oCE.Message + " The record you're trying to update has change since you view it, the system will update your form with the changes", "ConCurrent Error!");
DisplaySystemInfo();
catch (Exception ex)
MessageBox.Show(ex.Message, "Exception Error");
Thanks
Anthony

Good catch by Olaf - in your inner loop you still refer to ctx instead of ctx1.
Also, I noticed a typo in the word 'information'.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles

Similar Messages

  • Adding Entity Framework Crashes Visual Studio 2010/2013

    I'm having problem with using the Entity Framework version 6/5.  Whenever, I create the new solution and try to use the Entity Framework, Visual Studio crashes and restarts itself.  Scenarios are:
    1) Add Entity Framework by Add New Item-> Entity Framework-> go through wizard and finish...Crash.
    2) Add by Nuget console-> Install-Package Entityframework...Crash.
    3) Reload the solution from either #1 or #2, run Nuget console->Uninstall-Package Entityframework...Crash
    4) new solution, nuget package manager, select Entity Framework->Install...Crash.
    No matter what I do, and how I try to install entity framework, it keeps crashing on both VS 2010 and VS 2013.  It's frustrating when I'm trying to learn the technology.  Below are the Application error log I see in the Event Viewer:
    Log Name:      Application
    Source:        .NET Runtime
    Date:          4/29/2015 9:51:25 AM
    Event ID:      1025
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      DETROIT189L.HMMNA.COM
    Description:
    Application: devenv.exe
    Framework Version: v4.0.30319
    Description: The application requested process termination through System.Environment.FailFast(string message).
    Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Stack:
       at System.Environment.FailFast(System.String)
       at System.Management.Automation.WindowsErrorReporting.FailFast(System.Exception)
       at System.Management.Automation.CommandProcessorBase.CheckForSevereException(System.Exception)
       at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(System.Exception, System.Type, System.String, Int32, System.Reflection.MemberInfo)
       at DynamicClass.CallSite.Target(System.Runtime.CompilerServices.Closure, System.Runtime.CompilerServices.CallSite, System.Object, System.Object, System.Object, Boolean, Int32, System.Object, System.Object, System.Object, System.Object)
       at System.Dynamic.UpdateDelegates.UpdateAndExecute9[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Runtime.CompilerServices.CallSite, System.__Canon, System.__Canon, System.__Canon,
    Boolean, Int32, System.__Canon, System.__Canon, System.__Canon, System.__Canon)
       at System.Management.Automation.Interpreter.DynamicInstruction`10[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1<System.Management.Automation.Language.FunctionContext>, System.Object, System.Object)
       at System.Management.Automation.DlrScriptCommandProcessor.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][],
    System.Management.Automation.Language.FunctionContext)
       at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.PSScriptCmdlet.RunClause(System.Action`1<System.Management.Automation.Language.FunctionContext>, System.Object, System.Object)
       at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
       at System.Management.Automation.CommandProcessorBase.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][],
    System.Management.Automation.Language.FunctionContext)
       at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1<System.Management.Automation.Language.FunctionContext>, System.Object, System.Object)
       at System.Management.Automation.DlrScriptCommandProcessor.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][],
    System.Management.Automation.Language.FunctionContext)
       at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1<System.Management.Automation.Language.FunctionContext>, System.Object, System.Object)
       at System.Management.Automation.DlrScriptCommandProcessor.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
       at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
       at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
       at System.Threading.ThreadHelper.ThreadStart()
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name=".NET Runtime" />
        <EventID Qualifiers="0">1025</EventID>
        <Level>2</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2015-04-29T13:51:25.000000000Z" />
        <EventRecordID>29379</EventRecordID>
        <Channel>Application</Channel>
        <Computer>DETROIT189L.HMMNA.COM</Computer>
        <Security />
      </System>
      <EventData>
        <Data>Application: devenv.exe
    Framework Version: v4.0.30319
    Description: The application requested process termination through System.Environment.FailFast(string message).
    Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Stack:
       at System.Environment.FailFast(System.String)
       at System.Management.Automation.WindowsErrorReporting.FailFast(System.Exception)
       at System.Management.Automation.CommandProcessorBase.CheckForSevereException(System.Exception)
       at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(System.Exception, System.Type, System.String, Int32, System.Reflection.MemberInfo)
       at DynamicClass.CallSite.Target(System.Runtime.CompilerServices.Closure, System.Runtime.CompilerServices.CallSite, System.Object, System.Object, System.Object, Boolean, Int32, System.Object, System.Object, System.Object, System.Object)
       at System.Dynamic.UpdateDelegates.UpdateAndExecute9[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Runtime.CompilerServices.CallSite, System.__Canon, System.__Canon, System.__Canon,
    Boolean, Int32, System.__Canon, System.__Canon, System.__Canon, System.__Canon)
       at System.Management.Automation.Interpreter.DynamicInstruction`10[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1&lt;System.Management.Automation.Language.FunctionContext&gt;, System.Object, System.Object)
       at System.Management.Automation.DlrScriptCommandProcessor.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][],
    System.Management.Automation.Language.FunctionContext)
       at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.PSScriptCmdlet.RunClause(System.Action`1&lt;System.Management.Automation.Language.FunctionContext&gt;, System.Object, System.Object)
       at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
       at System.Management.Automation.CommandProcessorBase.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][],
    System.Management.Automation.Language.FunctionContext)
       at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1&lt;System.Management.Automation.Language.FunctionContext&gt;, System.Object, System.Object)
       at System.Management.Automation.DlrScriptCommandProcessor.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][],
    System.Management.Automation.Language.FunctionContext)
       at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon,
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)
       at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
       at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1&lt;System.Management.Automation.Language.FunctionContext&gt;, System.Object, System.Object)
       at System.Management.Automation.DlrScriptCommandProcessor.Complete()
       at System.Management.Automation.CommandProcessorBase.DoComplete()
       at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
       at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
       at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
       at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
       at System.Threading.ThreadHelper.ThreadStart()
    </Data>
      </EventData>
    </Event>

    Hi Hiroaki Morikawa,
    >>Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Based on the error message, I doubt that it is the memory performance issue, like this case:
    http://social.msdn.microsoft.com/Forums/en-US/71f134bd-d665-43b5-8c67-52c4d6ed4ed9/kinect-driver-problem?forum=kinectsdknuiapi.
    Please restart the system, stop all unnecessary third party processes, and make sure that your task manager is free,  then test again.
    Do you install the VS2010 and VS2013 in the same machine? If so, please also make sure that your machine has the enough configurations. To make sure that it is not the add-in issue, please also run your VS in safe mode, or run your VS as the admin, test
    it again.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Calling Oracle stored procedure with out param of user define type from Entity Framework 5 with code first

    Guys i am using Entity Framework 5 code first (I am not using edmx) with Oracle and all works good, Now i am trying to get data from stored procedure which is under package but stored procedure have out param which is user define type, Now my question is
    how i will call stored procedure from entity framework
    Thanks in advance.

    I agree with you, but issue is we have lots of existing store procedure, which we need to call where damn required. I am sure those will be few but still i need to find out.
    If you think you are going to get existing MS Stored Procedures  or Oracle Packages that had nothing to do with the ORM previously to work that are not geared to do simple CRUD operations with the ORM and the database tables, you have a rude awakening
    coming that's for sure. You had better look into using ADO.NET and Oracle Command objects and call those Oracle Packages by those means and use a datareader.
    You could use the EF backdoor, call Oracle Command object and use the Packages,  if that's even possible, just like you can use MS SQL Server Stored Procedures or in-line T-SQL via the EF backdoor.
    That's about your best shot.
    http://blogs.msdn.com/b/alexj/archive/2009/11/07/tip-41-how-to-execute-t-sql-directly-against-the-database.aspx

  • Entity Framework doesn't save new record into database

    Hy,
    I have problem with saving new record into database using Entity Framework.
    When I run program, everything seems normal, without errors . Program shows existing, manually added records into the database, and new one too. But new one isn't save into database after running program.
    I've got no idea where's problem. There is code for add new record, show existing.
    Thanks for help!!
    // add new record
    using (var db=new DatabaseEntitiesContext())
    var person = new Table()
    First_Name = "New_FName",
    Second_Name = "New_SName",
    PIN = "4569"
    db.Tables.Add(person);
    db.SaveChanges();
    //show all records
    using (var db=new DatabaseEntitiesContext())
    var selected = from x in db.Tables
    select x;
    foreach (var table in selected)
    Console.WriteLine("{0}{1}{2}",table.First_Name,table.Second_Name,table.PIN);

    Hi BownieCross;
    If you are using a local database file in your project the following may be the cause.
    From Microsoft Documentation:
    Issue:
    "Every time I test my application and modify data, my changes are gone the next time I run my application."
    Explanation:
    The value of the Copy
    to Output Directory property is Copy
    if newer or Copy
    always. The database in your output folder (the database that’s being modified when you test your application) is overwritten every
    time that you build your project. For more information, see How
    to: Manage Local Data Files in Your Project.
    Fernando (MCSD)
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects
    and unknown namespaces.

  • "Object reference not set to an instance of an object." in Visual Studio 2012 Entity Framework Model-First

    Hello
    We're trying to use a Model-First with Entity Framework in Visual Studio, targeting an Oracle XE 11g installation.
    No matter from what angle we're approaching the issue, we always end up with an "Object reference not set to an instance of an object" in Visual Studio:
    First way:
    - Add new ADO.NET Entity Framework Model to a .NET Framework 4.5 project
    - Empty model
    - Add some entities and associations
    - Set Database Generation Workflow to "Generate Oracle Via T4 (TPT).xaml"
    - Set DDL Generation Template to "SSDLToOracle.tt"
    - Generate Database From Model
    - VS asks for DB connection ==> Click "New Connection"
    - Enter the connection properties to the Oracle XE database. "Test Connection" tells me the connection is okay.
    - Click OK. Visual Studio shows the following error message:
    (here's the image if it's not visible: https://dl.dropboxusercontent.com/u/35614983/vs2012_oracle_ef_error.png)
    We also tried to generate the model in VS2010 and then manually transform it to an EF5 / VS2012 model. At the "Generate Database from Model" step, the same error appeared.
    We also tried to generate the model from database (Database-First approach). Same error.
    My configuration:
    - Windows 7 Ultimate 64-bit
    - Installed Oracle client: ODTwithODAC1120320_32bit.zip, so the version is 11.2.0.3.20
    - Visual Studio 2012 Update 3 (11.0.60610.01)
    Thanks for any hints!
    EDIT: I just read that ODP.NET doesn't seem to support Entity Framework 5, so I tried a new project with Entity Framework 4.1, but I get the same errors.
    EDIT 2: On a 32-bit Windows 7 virtual machine, everything works fine. Seems the problem is only there on my 64-bit Windows 7 machine.

    Sorry for the delay on this one. Let me know if you are still seeing this and I will see if we can get more diagnostic info somehow.
    That error is basically an exception fault. It means a bug or a misconfiguration of Oracle Developer Tools. Can you try to reinstall ODT and see if you notice any unusual errors during install.. and see if a reinstall fixes the problem?

  • I can't save the record in a new/empy table of sqlserver in the entity Framework 5.0

    Hi guys ,
    I have tried to become a database expert in Entity Framework but I can't. because I am not able to save the record in a fresh/ empty table of sql server 2008 r2 database. for that I have watched the video tutorials step by steps that how to save the record.
    I followed the tutorials step by step and at the end the result is negative.
    I tried a simple way given below. please some one help me that where and what I missing the.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using EmployeesLib;
    namespace EmpApplication
    public partial class Form1 : Form
    private EMPEntities _dbContext;
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    _dbContext = new EMPEntities();
    var sql = _dbContext.Employees;
    this.employeeBindingSource.DataSource = sql.ToList();
    private void employeeBindingNavigatorSaveItem_Click(object sender, EventArgs e)
    this.Validate();
    _dbContext.SaveChanges();
    I have used datagrid addid a row by Click Add button on the NavigationBindingsource entered an employee name
    and clicking the save button on the NavigationBindingSource. When I am restarting the application I nothing founding on the Datagrid I am saving before.
    below is the Connection String in the App.config file both in the project.
    APP.CONFIG connection string
        <add name="EMPEntities" connectionString="metadata=res://*/EmpModal.csdl|res://*/EmpModal.ssdl|res://*/EmpModal.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=Inventory;integrated
    security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

    humm, I falling the ball to the batsman(sqlserver) but it getting "NOBALL" in response(not saving). Ok it my be problem in visual studio I am struggling to remove my operating System, VS2013 and sql server, by reinstalling it might works.
    because i havent any other computer where these application are installed for the test.
    If you create and send me a small project that contain minimum of two columns of table( in sql server ) which can saving new data from datagrid so i will thankfull of you.
    it is just for confirmation that either the problem is in OS or VS.
    I doubt that any of it has anything to do with the issue. If you think it does, then you can post to the forums.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vssetup
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver
    I think you are riding a bad horse (that tutorial) you are using, and you need to change horses. I think the 'modified' state is not being rasied on the entity bound to the grid when it has changed, and EF is not going save any entity that's not in a modified
    state.

  • Multiple database users, ORM, entity framework, best practices

    Hello everyone!
    You've already helped me several times, however I must ask for an advice once more.
    I was assigned to develop .NET application with Data Access Layer and I've decided to use Oracle Database Software to provide sample data.
    As I'm absolute novice considering creating DAL I'd be grateful if you can examine my plan in terms of security and reliability:
    My database:
    1) I've created database with sample tables and relations between them. All tables belongs to databaseAdmin.
    2) I've created HR and Manager database users and granted them some privileges on certain databaseAdmin's tables. My intention is to reduce access to unnecessary tables. If my application user want to make some changes to Customers table it should be enough to connect to database as HR.
    And now I'd like to map my database using Entity Framework in my application. And that's where I have a problem:
    -If I create Entity Model basing on databaseAdmin tables I get perfect model, however every Entity SQL query would be executed on behalf of databaseAdmin, which breaks my idea of hiding unnecessary tables.
    -If I create Entity Model for HR and Manager users, my models could overlap on tables that both users have access to and no connection between tables would be generated (as from their point of view those tables are just some tables that belong to databaseAdmin)
    Could you help me with this deadlock? Or maybe my assumptions about multiple database users are incorrect? Please, bear in mind I'm a novice.
    I was trying to find a solution in web, and there're tons of data discussing technical aspects of Entity Framework etc., but not so many documents about conceptual model of database.

    hi Michael,
    Thanks for you posting!
    Sorry for I am not totally understanding your issue. Maybe two points need your confirm:
    1. I confuse with the "Service controller"? IS your meaning MVC controller? Or ServiceController(http://www.codeproject.com/Articles/31688/Using-the-ServiceController-in-C-to-stop-and-start
    2.whether  The type of ID in the model is match to the database ? In other words, Is the type of IDin .edmx matched to the database?
    By the way, it seems that this issue is more related to EF. You could post this issue on EF discussion for better support.
    Thanks & Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Entity Framework : Outer Joins

    Hello,
    I'm trying to solve some issues with an application that I'm developing....
    I have a problem with outer joins:
    var query = (from i in dbo.ITEMs
                             join o in dbo.ORGANIZATIONs on i.ORGSEQNO equals o.ORGSEQNO
                             join iv in dbo.ITEMVERSIONs on i.ITEMSEQNO equals iv.ITEMSEQNO
                             join it in dbo.ITEMTARGETs on iv.VERSIONSEQNO equals it.VERSIONSEQNO
                             join id in dbo.ITEMDESCRIPTIONs.DefaultIfEmpty() on it.ITEMTARGETSEQNO equals id.ITEMTARGETSEQNO
                             select i).AsQueryable();
    If I remove the DefaultIfEmpty the query works as expected, with the "DefaultIfEmpty" in, it generates a sub-select that doesn't execute.
    1 ORA-00904: "SingleRowTable3"."X": invalid identifier SQL1.sql 44 23
    This is the occorring error.
    Thanks for your help.

    You can check my thread Entity Framework generates invalid oracle sql.
    Generally Entity Framework sometimes generates joins using APPLY which does not work on NON SQL SERVER system.

  • Best Practices for Using Service Controller for Entity Framework Database

    I'm running into an issue in my first time creating a Web Service with a .NET backend with Azure. I designed a database in Entity Framework and had it create the models, but I couldn't create a controller for the table unless I made the model inherit from
    EntityData. Here's the catch, the Database Model has int Id, but EntityData has string Id, so, of course, I'm getting errors. What is best practice for what I'm trying to do?
    Michael DiLeo

    hi Michael,
    Thanks for you posting!
    Sorry for I am not totally understanding your issue. Maybe two points need your confirm:
    1. I confuse with the "Service controller"? IS your meaning MVC controller? Or ServiceController(http://www.codeproject.com/Articles/31688/Using-the-ServiceController-in-C-to-stop-and-start
    2.whether  The type of ID in the model is match to the database ? In other words, Is the type of IDin .edmx matched to the database?
    By the way, it seems that this issue is more related to EF. You could post this issue on EF discussion for better support.
    Thanks & Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Good practice for async databinding, regarding entity-framework.

    I have some issue to find a good pattern to keep my UI responsive using asynch databinding and entity framework which is not thread-safe. It would be a shame if the UI came to totaly freeze with no feedback for a connection lost.
    So, entity framework is not thread-safe. Which mean I won't be able to rely on lazy loading here and involve than if I do async databinding to a collection of object, each object will have to load their navigations properties with their own context to display
    data. Ok, I can handle this. But what if I need more than displaying data and I want to modify a navigation property ?
    I need when I set the navigation property in my viewmodel to attach an entity from the same context than the parent entity is from. So here I have one context for multiple thread. What do I do ? =(
    Does anyone have some experience in it and can help me to clear this mess from my mind ? =D
    All the sample I can find about async databinding don't go any further than make a Thread.Sleep before returning a string, it's not realy helpfull.

    There are reasons people post simple explanations.
    One of those is because they post blog entries when they're learning something rather than when they are expert in it.  The blog post is part of their learning process.
    I sometimes share context. 
    What I do is put the context in Application.Current.Resources and then go get it from there when I need to re-use that particular one.
    xxxDomainContext DBContext = new xxxDomainContext();
    Application.Current.Resources.Add("DBContext", DBContext);
    and using that:
    context = (xxxxDomainContext)Application.Current.Resources["DBContext"];
    You can alternatively share collections in a similar way.  Depends on how many related tables you have, but reading a whole tree of static data is sometimes a good idea rather than just one table at a time.
    One technique I use is to cache slowly changing data on the client and then go get changes since the last run off the server.  For a fair few applications, yesterdays data is good enough for most data sets.  It's just the odd one or two which you really
    need up to date numbers or whatever.
    You can see a collection shared in this sample ( but the sharing is for different reasons ) :
     https://gallery.technet.microsoft.com/Dynamic-XAML-Composed-View-e087f3c1
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • Using Entity Framework with SQL Azure - Reliability

    (This is a cross post from http://stackoverflow.com/questions/5860510/using-entity-framework-with-sql-azure-reliability since I have yet to receive any replies there)
    I'm writing an application for Windows Azure. I'm using Entity Framework to access SQL Azure. Due to throttling and other mechanisms in SQL Azure, I need to make sure that my code performs retries if an SQL statement has failed. I'm trying to come up with
    a solid method to do this.
    (In the code below, ObjectSet returns my EFContext.CreateObjectSet())
    Let's say I have a function like this:
      public Product GetProductFromDB(int productID)
         return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
    Now, this function performs no retries and will fail sooner or later in SQL Azure. A naive workaround would be to do something like this:
      public Product GetProductFromDB(int productID)
         for (int i = 0; i < 3; i++)
            try
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
            catch
    Of course, this has several drawbacks. I will retry regardless of SQL failure (retry is waste of time if it's a primary key violation for instance), I will retry immediately without any pause and so on.
    My next step was to start using the Transient Fault Handling library from Microsoft. It contains RetryPolicy which allows me to separate the retry logic from the actual querying code:
      public Product GetProductFromDB(int productID)
         var retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(5);
         var result = _retryPolicy.ExecuteAction(() =>
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault;
         return result;
    The latest solution above is described as ahttp://blogs.msdn.com/b/appfabriccat/archive/2010/10/28/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications.aspx Best Practices for Handling Transient Conditions in SQL Azure Client
    Application (Advanced Usage Patterns section).
    While this is a step forward, I still have to remember to use the RetryPolicy class whenever I want to access the database via Entity Framework. In a team of several persons, this is a thing which is easy to miss. Also, the code above is a bit messy in my
    opinion.
    What I would like is a way to enforce that retries are always used, all the time. The Transient Fault Handling library contains a class called ReliableSQLConnection but I can't find a way to use this with Entity Framework.
    Any good suggestions to this issue?

    Maybe some usefull posts
    http://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx
    http://geekswithblogs.net/iupdateable/archive/2009/11/23/sql-azure-and-entity-framework-sessions-from-pdc-2009.aspx

  • Seeding multiple databases with single Entity Framework context

    I am developing a single-instance, multi-tenant web application, with a SQL database using Entity Framework 6 Code-First. 
    I want to have a separate database for each client, generated from the same EF models, with a single DbContext. The database to connect to will be determined by the subdomain that the client is using the web app from. 
    This seems to work fine and the correct database is connected to depending on the subdomain. However my issue is seeding the databases with data. This is the code I have:
    foreach (var connString in ConfigurationManager.ConnectionStrings.Cast<ConnectionStringSettings>()))
    Configuration.PerformDatabaseMigration(connString.Name);
    This then calls the PerformDatabaseMigration method: 
    public class Configuration : DbMigrationsConfiguration<DataContext>
    public Configuration()
    AutomaticMigrationsEnabled = false;
    AutomaticMigrationDataLossAllowed = false;
    public static void PerformDatabaseMigration(string connStringName)
    var databaseInitialiser = new Configuration { TargetDatabase = new DbConnectionInfo(connStringName) };
    var dbMigrator = new DbMigrator(databaseInitialiser);
    dbMigrator.Update();
    protected override void Seed(DataContext context)
    base.Seed(context);
    var superAdmin = new User { Id = 1, UserName = "SuperAdmin" };
    context.Users.AddOrUpdate(superAdmin);
    The issue is that when seeding this data for the second database, the context passed into the Seed method already has the admin user added to the `DbSet<User>` property of the context, even though the context is for the second databse connection, not
    the first. It appears that the context is not being cleared from seeding the first database, and so I receive a `DbUpdateException`, as my User.Username field is a unique index.
    Cannot insert duplicate key row in object 'dbo.Users' with unique index 'IX_UserName'. The duplicate key value is (SuperAdmin).\r\nThe statement has been terminated.
    public class User : ModelBase, IUserIdentity, IPrincipal, IIdentity 
        [Index(IsUnique = true)]     
      [Required]     
      [StringLength(40)]       
    public string UserName { get; set; }

    Hello Attune,
    >>This seems to work fine and the correct database is connected to depending on the subdomain. However my issue is seeding the databases with data.
    Is that you firstly create these databases and then call the PerformDatabaseMigration method to seed these database with data? Do you have a try to seed these database data when creating the database with AutomaticMigrationsEnabled = true; with your provided
    configuration class, I tested it and it could work as seeding same data to different database:
    internal sealed class Configuration : DbMigrationsConfiguration<CFs.CFContext>
    public Configuration()
    AutomaticMigrationsEnabled = true;
    public static void PerformDatabaseMigration(string connStringName)
    var databaseInitialiser = new Configuration { TargetDatabase = new DbConnectionInfo(connStringName) };
    var dbMigrator = new DbMigrator(databaseInitialiser);
    dbMigrator.Update();
    protected override void Seed(CFs.CFContext context)
    base.Seed(context);
    var superAdmin = new ApplicationUser() { ApplicationUserID = 1, FirstName = "", LastName = "" };
    context.ApplicationUsers.AddOrUpdate(superAdmin);
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using both Enterprise library and Entity framework as DAL for same application

    We have been using EF for large amount of data  retrieval in our current application. We faced performance related issues with using EF with large data retrieval and manipulation.
    We need to extend the same project with some additional functionality similar to what currently exists in the application and uses EF.
    For the new functionality, we do not want to use EF and want to use enterprise library for Data access.
    My question is if we use both entity framework for parts of the application data access mechanism and enterprise library for other parts of application data access, are there any known issues?
    if there are any best practices to be followed please share .

    We have been using EF for large dataset retrieval in our current application. We faced performance related issues with using EF for large data set's  .
    Dataset? What are you talking about?  If you are using the salad bowl, the dataset with datatables, then here is the reason not to use them.
    http://lauteikkehn.blogspot.com/2012/03/datatable-vs-list.html
    My question is if we use both entity framework for parts of the application data access mechanism and enterprise library for other parts of application data access, are there any known issues?
    What is Entlib going to buy you in performance? It's going to buy you nothing. You'll be better of going to the EF backdoor, use SQL command objects, inline T-SQL, sprocs, datareder and using custom objects or objects off of the virtual model returning a
    single object or objects in a collction., if you are concerned about performance.
    http://blogs.msdn.com/b/alexj/archive/2009/11/07/tip-41-how-to-execute-t-sql-directly-against-the-database.aspx
    You'll probably be better of going to Entity SQL, using a datareader, collection and using custom objects or objects off of the model, if you are concerned about query performance.
    https://msdn.microsoft.com/en-us/library/vstudio/bb738684(v=vs.100).aspx
    https://msdn.microsoft.com/en-us/library/vstudio/bb387145(v=vs.100).aspx
    https://msdn.microsoft.com/en-us/library/vstudio/bb399560(v=vs.100).aspx
    My question is if we use both entity framework for parts of the application data access mechanism and enterprise library for other parts of application data access,
    are there any known issues?
     A nightmare, no consistency and complete Helter Skelter is what I see. Been there and seen it in action with different technologies doing the same thing in a solution.

  • Entity Framework in WPF Application - Using Statement or Implement IDisposable

    I have a WPF application that uses Entity Framework.
    I have implemented a Repository that implements IDisposable, that holds my EF context.  When the application starts up I new up a Repository, which news up an EF context, then when the application shuts down, I dispose of my Repository, which disposes
    the EF context as well.
    The end result is that my context remains open during the entire lifetime of the application.  
    I've been reading up on EF, and all the examples put the operations against the EF context in a using statement.  Is that the preferred approach?  What is the priority: to keep the context open briefly, or just to make sure you properly dispose
    of it when you're finished with it.
    Thanks.
    Aaron

    >
    https://msdn.microsoft.com/en-us/library/aa355056(v=vs.110).aspx
    That link is only for WCF and it's broken implementation of the Dispose pattern.
    >I have been burnt in doing it where the connection was not closed or disposed when it short-circuted out of the Using statement on exception
    If so, it was a bug.  You should expect that not to happen.
    'using' will close your connection, unless the connection was open before the DbContext and was passed in.  'using' is the safest way to ensure that the connections are closed in a timely manner.
    David
    David http://blogs.msdn.com/b/dbrowne/
    I absoultly do not agree with you. I have been burnt in using the Using statment. And it was along the lines that an excpetion was thrown within the Using statement and no closing of the connection or dispoiong of it ever occured, which is what the WCF example
    is showing on how a Using statement can be short-circuted and things can go wrong.
    I don't care if the Using statement issue is being shown on a WCF typed cleint. I do the same thing in using straight up ADO.NET or EF, becuase I have been burnt by the Using statement, and I dont use them to open,  close or dispose of a connection.

  • Known concurrency issues around refreshObject

    Hi
    We are using Toplink 10.1.3 within 10gAS 10.1.3.
    We use ORA_ROWSCN as the version number field within our Optimistic Locking Policy, which Oracle does not populate until the transaction commits.
    Therefore we added a PostCommitEventListener.postCommitUnitOfWork method to refresh the objects prior to returning after an update. Otherwise we found that the objects in the cache, and those returned to our client tier, did not have the updated SCN.
    This works fine... BUT we have just found a concurrency issue that we believe may be related to this.
    If two Units Of Work are simultaneously attempting to update the same object instance this allows the possibility of the second Unit Of Work committing it's change whilst the first is still refreshing, after which something goes wrong, and subsequent attempts to access the object appear to hang, which is ultimately reported by the Oracle HTTP Server as a timeout.
    We are trying to recreate this within an automated test which may further enlighten us.
    Two questions:
    1. Are there any known concurrency issues with mutiple Units of Work calling refreshObject on the same object?
    2. Can anyone suggest a less expensive method of ensuring that the version number within our domain objects, gets updated with the ORA_ROWSCN after the commit?
    As always, any help appreciated.
    Will post further as analysis contimues.
    Marc
    Edited by: user6568216 on 25-Sep-2008 09:56

    Thanks for the reply.
    Are you saying that the cause of the issue is the use of the postCommitEventListener to refresh the objects?
    Currently, the use of a version number field rather than ORA_ROWSCN is not an option, mainly because we have many update procedures that don't go via the Toplink Cache, and would therefore need amending to increment the version number fields or use triggers (current not seen as ideal due to batch issues). As we have more than 1000 tables, this is not feasible within the current release lifecycle of our product.
    I attahc the complete thread dump, but this has been generated as a thread dump from the OC4J instance, as the application just hangs and eventually generates a time out.
    Is there anything we can do to mitigate against this issue?
    Many Thanks
    Marc
    Thread Dump:
    Full thread dump Java HotSpot(TM) Client VM (1.5.0_15-b04 mixed mode):
    "ApplicationServerThread-1" prio=6 tid=0x532e27e0 nid=0xf10 waiting for monitor entry [0x5517d000..0x5517fd68]
         at java.util.Vector.size(Vector.java:270)
         - waiting to lock <0x08761fb0> (a java.util.Vector)
         at oracle.toplink.internal.queryframework.CollectionContainerPolicy.sizeFor(CollectionContainerPolicy.java:164)
         at oracle.toplink.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:899)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:913)
         - locked <0x08761f50> (a java.util.Vector)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:913)
         - locked <0x087626f8> (a java.util.Vector)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:913)
         - locked <0x08762e70> (a java.util.Vector)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:913)
         - locked <0x0863b600> (a java.util.Vector)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:392)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:392)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:392)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.publicinterface.UnitOfWork.revertObject(UnitOfWork.java:4034)
         at oracle.toplink.publicinterface.UnitOfWork.revertObject(UnitOfWork.java:4010)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.registerIndividualResult(ObjectLevelReadQuery.java:1727)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:449)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:413)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:376)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:451)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.registerIndividualResult(ObjectLevelReadQuery.java:1701)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.conformIndividualResult(ObjectLevelReadQuery.java:615)
         at oracle.toplink.queryframework.ReadObjectQuery.conformResult(ReadObjectQuery.java:321)
         at oracle.toplink.queryframework.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:586)
         at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:403)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:800)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:603)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:768)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:370)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:825)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2532)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:981)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:938)
         at oracle.toplink.publicinterface.Session.refreshAndLockObject(Session.java:2564)
         at oracle.toplink.publicinterface.Session.refreshObject(Session.java:2575)
         at aquila.administrator.server.PostCommitEventListener.postCommitUnitOfWork(PostCommitEventListener.java:67)
         at oracle.toplink.sessions.SessionEventManager.postCommitUnitOfWork(SessionEventManager.java:277)
         at oracle.toplink.publicinterface.UnitOfWork.commit(UnitOfWork.java:867)
         at org.springframework.orm.toplink.TopLinkTransactionManager.doCommit(TopLinkTransactionManager.java:385)
         at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
         at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
         at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy66.createNewTemplateVersion(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy211.createNewTemplateVersion(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)
         at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
         at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
         at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)
         at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)
         at aquila.administrator.platform.server.httpinvoker.AquilaHttpInvokerServiceExporter.handleRequest(AquilaHttpInvokerServiceExporter.java:77)
         at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.securechannel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:138)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:629)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    "ApplicationServerThread-0" prio=6 tid=0x52fe0d88 nid=0xd2c waiting for monitor entry [0x53b8d000..0x53b8f9e8]
         at java.util.Vector.size(Vector.java:270)
         - waiting to lock <0x0863b600> (a java.util.Vector)
         at oracle.toplink.internal.queryframework.CollectionContainerPolicy.sizeFor(CollectionContainerPolicy.java:164)
         at oracle.toplink.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:899)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:392)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:392)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:392)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:913)
         - locked <0x08761fb0> (a java.util.Vector)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2095)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:534)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:228)
         at oracle.toplink.publicinterface.UnitOfWork.revertObject(UnitOfWork.java:4034)
         at oracle.toplink.publicinterface.UnitOfWork.revertObject(UnitOfWork.java:4010)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.registerIndividualResult(ObjectLevelReadQuery.java:1727)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:449)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:413)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:376)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:451)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.registerIndividualResult(ObjectLevelReadQuery.java:1701)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.conformIndividualResult(ObjectLevelReadQuery.java:615)
         at oracle.toplink.queryframework.ReadObjectQuery.conformResult(ReadObjectQuery.java:321)
         at oracle.toplink.queryframework.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:586)
         at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:403)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:800)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:603)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:768)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:370)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:825)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2532)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:981)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:938)
         at oracle.toplink.publicinterface.Session.refreshAndLockObject(Session.java:2564)
         at oracle.toplink.publicinterface.Session.refreshObject(Session.java:2575)
         at aquila.administrator.server.PostCommitEventListener.postCommitUnitOfWork(PostCommitEventListener.java:67)
         at oracle.toplink.sessions.SessionEventManager.postCommitUnitOfWork(SessionEventManager.java:277)
         at oracle.toplink.publicinterface.UnitOfWork.commit(UnitOfWork.java:867)
         at org.springframework.orm.toplink.TopLinkTransactionManager.doCommit(TopLinkTransactionManager.java:385)
         at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
         at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
         at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy66.createNewTemplateVersion(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy211.createNewTemplateVersion(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)
         at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
         at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
         at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)
         at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)
         at aquila.administrator.platform.server.httpinvoker.AquilaHttpInvokerServiceExporter.handleRequest(AquilaHttpInvokerServiceExporter.java:77)
         at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.securechannel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:138)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:629)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    "DestroyJavaVM" prio=6 tid=0x00035590 nid=0xb34 waiting on condition [0x00000000..0x0007fae8]
    "TaskManager" prio=6 tid=0x53700d48 nid=0xfb4 waiting on condition [0x5513f000..0x5513fa68]
         at java.lang.Thread.sleep(Native Method)
         at com.evermind.util.TaskManager.run(TaskManager.java:245)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    "Store userCache Spool Thread" daemon prio=2 tid=0x537ab3c0 nid=0x50c waiting on condition [0x550ff000..0x550ffae8]
         at java.lang.Thread.sleep(Native Method)
         at net.sf.ehcache.store.DiskStore.spoolAndExpiryThreadMain(DiskStore.java:573)
         at net.sf.ehcache.store.DiskStore.access$800(DiskStore.java:65)
         at net.sf.ehcache.store.DiskStore$SpoolAndExpiryThread.run(DiskStore.java:1057)
    "ApplicationServerThread-7" prio=6 tid=0x52fe1520 nid=0x854 runnable [0x540bf000..0x540bfb68]
         at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
         at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:275)
         at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:257)
         at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:138)
         at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
         - locked <0x06bf5b98> (a sun.nio.ch.Util$1)
         - locked <0x06bf5b88> (a java.util.Collections$UnmodifiableSet)
         - locked <0x06bf48d8> (a sun.nio.ch.WindowsSelectorImpl)
         at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
         at oracle.oc4j.network.NIOServerSocketDriver.select(NIOServerSocketDriver.java:195)
         at oracle.oc4j.network.NIOServerSocketDriver.run(NIOServerSocketDriver.java:150)
         at com.evermind.server.http.HttpConnectionListener.run(HttpConnectionListener.java:271)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    "ApplicationServerThread-6" prio=6 tid=0x5301d7f0 nid=0xda0 runnable [0x5407f000..0x5407fbe8]
         at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
         at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
         - locked <0x06bf8890> (a java.lang.Object)
         at sun.nio.ch.ServerSocketAdaptor.accept(ServerSocketAdaptor.java:84)
         - locked <0x06bf8870> (a java.lang.Object)
         at oracle.oc4j.network.ServerSocketAcceptHandler$BImpl.run(ServerSocketAcceptHandler.java:666)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    "ApplicationServerThread-5" prio=6 tid=0x52fc31d8 nid=0xda4 waiting on condition [0x5403f000..0x5403fc68]
         at java.lang.Thread.sleep(Native Method)
         at oracle.as.j2ee.transaction.tpc.recovery.RecoveryManager.run(RecoveryManager.java:358)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    "Timer-3" prio=6 tid=0x52fc5ef8 nid=0x860 in Object.wait() [0x53fff000..0x53fffce8]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x06b59c08> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:509)
         - locked <0x06b59c08> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-2" prio=6 tid=0x52fc9a08 nid=0xefc in Object.wait() [0x53fbf000..0x53fbfd68]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x06b16268> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:509)
         - locked <0x06b16268> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "WorkExecutorWorkerThread-1" daemon prio=6 tid=0x53166c38 nid=0xe3c in Object.wait() [0x53f7f000..0x53f7fa68]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x06c76838> (a java.lang.Object)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.doReceive(WorkConsumer.java:995)
         - locked <0x06c76838> (a java.lang.Object)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:215)
         - locked <0x06c766f0> (a oracle.j2ee.ra.jms.generic.WorkConsumer)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
         at java.lang.Thread.run(Thread.java:595)
    Continued on next post

Maybe you are looking for

  • Spry horizontal menu titles

    Ok here is my problem. I am using the spry horizontal menu and am trying to make a list of drop down menus. Rather than having sub menus that have flyout child menus I just want to have a list of menus that have titles. Basically What I want would be

  • Slow framerates and weird shaders in game

    Inside the game "Sauerbraten" which is a 3D shooter, I get very low framerates and some surfaces with shaders have strange glitches on them. I have Mac OS X Leopard 10.5.2, and I have the game and OS up to date. To make sure this wasn't just with the

  • Signature text not picked up in standard correspondence SAP10

    Hello FI experts There is a requirement in my project to send standard letters to vendors and cutomers. I have doen all the settings, correspondence type, form etc.has been done; but the signature text is not picked up in the form. I have dfefined th

  • Dynamically define target address for logical ports (NW'04)

    Hello, when developing a web-service client using standalone proxy, you have to define the target address of a Web Service in the property-page for the Logical Port. We have the following problem. If, for any reason, the URL of the Web Service change

  • How can I clear the cache of my iOS maps app?

    Some portions of my map are not loading properly.  Square spaces have some features like parks and rivers, but no roads.  Is there a way to manually clear the cache of the Maps app without restoring the entire phone?