Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-3119
FAX: (715)284-4084
[cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, December 10, 2014 8:54 AM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E10: Handling database updates in method directives - Revisited **Bump**
I might decide to just always use it (except for tt records) but I was surprised to see situations where I did not need to use it.
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:1ec31e.png@068d3d1d.4488c09e]
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.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, December 10, 2014 9:48 AM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E10: Handling database updates in method directives - Revisited **Bump**
I noticed that I don’t have to use the txScope when I update the tt records, but otherwise I do use the it.
Brenda
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, December 10, 2014 9:33 AM
To: vantage@yahoogroups.com
Subject: [Vantage] E10: Handling database updates in method directives - Revisited **Bump**
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@...<mailto:jrojas@...> | www.matsinc.com<http://www.matsinc.com>
Ask us about our clean, green and beautiful matting and flooring
[cid:8e3485.png@14a1e8f3.479dd530]
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]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]