When to use PXConnectionScope, and when to avoid it

Hello everybody,

today I want to leave a very short note-reminder. Mainly for myself, but maybe someone else may benefit from it also. 

In Acumatica there is wonderful scope: PXConnectionScope. It is needed for the following situation: if you need to raw data from database eliminating cache. For this purposes is also fine PXSelectReadOnly, but if you want to open a new connection, and read from db raw data, then it's better to read them through PXConnectionScope. 

Also want to mention few rakes, which stolen from me enormous amount of time.

  1. If you want to read some data during RowSelecting or FieldSelecting, potentially it may be a good idea to use PXConnectionScope
  2. If you want to read some data during overriding action Persist, it's better to avoid PXConnectionScope, as you can get Connection time out error message because of dead locking.

And one more point, sometime it may be needed to increase timeout. web.config sample shows how to achieve it:

      <httpRuntime executionTimeout="1500" requestValidationMode="2.0" maxRequestLength="1048576" />


If you need raw data on RowSelecting, go ahead with PXConnectionScope. If you need raw data on Persist, consider PXSelectReadOnly.

Add comment