BPM Proper Record lookup using the Db context

(Caleb Grundmeier) #1

I’m curious if there is best practice to do lookups using the Db context in a BPM. I currently have an external BPM that is looking up records in UD106A. Similiar to this:

  var   results = Db.UD106A.Where(w =>
            w.Company == company
            && w.Key1 == key1
            && w.Key2 == key2
            && w.Key3 == key3
            && w.Key4 == key4
        && w.Key5 == key5)

There are a lot of records in this table and it’s hit quite often to do lookups. Come to find out the app server is holding 8GB worth of Ice.Tables.UD106A objects after doing a memory dump using the Performance and Diagnostics Tool. A quick google search recommended using the .AsNoTracking() extension? Any thoughts?


(Chris Conn) #2

That looks correct to me. The more filtering you can do, the better.