Welcome to the Milos Blog!

Thursday, January 25, 2007
New CoDe Focus Special Issue: Sedna

EPS is about to publish a new CoDe Focus issue (CoDe Magazine special issue). It is called "Sedna: Beyond VFP 9", and that is pretty much exactly what it covers.

The cool thing is that this print magazine is completely free of charge. All you have to do to get it is sign up. However, note that the print-run is limited, and a lot of issues already are claimed. So if you are interested, make sure to sign up as quickly as possible. Here is the signup URL:

http://www.code-magazine.com/focus/interests.aspx

Make sure you indicate that you are interested in Visual FoxPro development.

Enjoy! And feel free to pass this on...

Note: We are planning a few other issues for the next months as well. The signup URL for those is the same...



Posted @ 4:29 PM by Egger, Markus (markus@code-magazine.com) - Comments


Monday, January 15, 2007
Atomic Saves and Transactions

One of our clients was having a problem with atomic saves and transactions in Milos, and it was kind of tricky to figure it out.

Business Objects were sharing the same data context so that the entities would get saved wrapped up on the same transaction. One of the Business Objects has a Business Rule that instantiates another Business Object and calls a method on it to check if a given row exists already on the database. In this scenario, the row was being added on the same transaction, but the call to this look up method was timing out (indicating that it couldn't read the row just added on the transaction. The code looked like this:

public
override void VerifyRow(DataRow currentRow, int rowIndex)
{
   if (!currentRow.IsNull("fkTrade"))
   {
    using (TradeBusinessObject oBizObj = new TradeBusinessObject())
      {
         Guid fkTrade = (Guid)currentRow["fkTrade"];

         string
tradeName = currentRow["TradeName"].ToString();
     DataSet ds = oBizObj.GetList(fkTrade);
         if (ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
         {
             this.LogBusinessRuleViolation(currentRow, rowIndex, "fkTrade", "The Trade '" + tradeName + "' does not exist.");
         }
      }
   }
}

Notice that the TradeBusinessObject has its own data context, and therefore, the call to GetList can't seem any row created by the transaction shared by main business object where the business rule lives in. All that needs to be done in this case is to make the object share the same data context, like so (the following line must come after the object is instantiated, but before the GetList method is called on it):

oBizObj.ShareDataContext((
BusinessObject)this.BusinessObject);



Posted @ 4:52 PM by Lassala, Claudio (lassala@foxbrasil.com.br) - Comments


Archive:
July, 2009 (2)
February, 2009 (2)
January, 2009 (1)
December, 2008 (1)
October, 2008 (3)
June, 2008 (1)
April, 2008 (3)
February, 2008 (1)
January, 2008 (1)
December, 2007 (1)
October, 2007 (2)
September, 2007 (2)
July, 2007 (1)
June, 2007 (2)
May, 2007 (4)
April, 2007 (6)
March, 2007 (8)
February, 2007 (3)
January, 2007 (2)
December, 2006 (2)
November, 2006 (2)


Blog Stats:
Posts: 50
RSS Syndication

Contact:

EPS Software Corp.
6605 Cypresswood Dr., Suite 300
Spring, TX 77379
United States

Phone: 832-717-4445
Email: info@MilosSolutionPlatform.com

Other EPS Properties

EPS Software Homepage
EPS Custom Software
CoDe Magazine
CoDe Focus Magazine
VFPConversion.com
WPFExperts.com
MarkusEgger.com

(c) by EPS Software Corp. 2001 - 2010