Hi All,
As we have been converting our BPMs from E9 to E10, one of the things this group taught me was that I should be using a Transaction Scope when I need to update the database directly.
This has been working well but I notice that it does not seem to be required, at least not in all cases.
I have a customization that uses UD11 to store information we need related to Sales Orders, Jobs, and POs.
When a new UD11 record is created or deleted, it will update a UD filed on the related record.
I had already converted this BPM before learning about Transaction Scope so I started testing it without one.
I figured I would get error messages or find that the DB wasn’t get updated but neither happened.
In the end, the expected record was updated.
My question is, are there cases/scenarios that don’t need (or even where we shouldn’t use) a transaction scope and/or a DB.Validate? Or should I just be using them all the time anyway?
Is it more complex than “use or don’t use�
I’m just looking for some guidance. I hate to add lines of code that aren’t needed but I’d also hate to not add lines of code that may create erratic behavior.
Here is an example of a code snippet when it needs to update Number01 in OrderRel.
OrderRel = (from OrderRel_Row in Db.OrderRel
where string.Compare(OrderRel_Row.Company, ttUD11Row.Company, true) == 0
&& OrderRel_Row.OrderNum == ttUD11Row.Number05
&& OrderRel_Row.OrderLine == ttUD11Row.Number06
&& OrderRel_Row.OrderRelNum == ttUD11Row.Number07
select OrderRel_Row).FirstOrDefault();
…
…
OrderRel["Number01"] = (decimal)OrderRel["Number01"] + (decimal)ttUD11Row["Number01"];
There is no Transaction Scope, no DB.Validate, but the record is updated.
Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring
[cid:a7afd8.png@ad398a6a.478f3103]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
[Non-text portions of this message have been removed]
As we have been converting our BPMs from E9 to E10, one of the things this group taught me was that I should be using a Transaction Scope when I need to update the database directly.
This has been working well but I notice that it does not seem to be required, at least not in all cases.
I have a customization that uses UD11 to store information we need related to Sales Orders, Jobs, and POs.
When a new UD11 record is created or deleted, it will update a UD filed on the related record.
I had already converted this BPM before learning about Transaction Scope so I started testing it without one.
I figured I would get error messages or find that the DB wasn’t get updated but neither happened.
In the end, the expected record was updated.
My question is, are there cases/scenarios that don’t need (or even where we shouldn’t use) a transaction scope and/or a DB.Validate? Or should I just be using them all the time anyway?
Is it more complex than “use or don’t use�
I’m just looking for some guidance. I hate to add lines of code that aren’t needed but I’d also hate to not add lines of code that may create erratic behavior.
Here is an example of a code snippet when it needs to update Number01 in OrderRel.
OrderRel = (from OrderRel_Row in Db.OrderRel
where string.Compare(OrderRel_Row.Company, ttUD11Row.Company, true) == 0
&& OrderRel_Row.OrderNum == ttUD11Row.Number05
&& OrderRel_Row.OrderLine == ttUD11Row.Number06
&& OrderRel_Row.OrderRelNum == ttUD11Row.Number07
select OrderRel_Row).FirstOrDefault();
…
…
OrderRel["Number01"] = (decimal)OrderRel["Number01"] + (decimal)ttUD11Row["Number01"];
There is no Transaction Scope, no DB.Validate, but the record is updated.
Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring
[cid:a7afd8.png@ad398a6a.478f3103]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
[Non-text portions of this message have been removed]