Navigation


Milos Solution Platform (External Blog)

The Milos Solution Platform is .NET's premier platform for building business applications. This blog is meant for developers who use or evaluate Milos. This blog is used to share tidbits of information provided by the Milos developers at EPS. Many of the posts put the spotlight on new features. We generally recommend that all Milos users (developers) at least scan this blog to keep up with the Milos news.

Content Area Footer

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 (1)


 

 

 

 

 

 

 

Syndication RSS 2.0 RSS 2.0

All My Blogs:
My personal blogs:
Dev and Publishing Dev and Publishing
Travel and Internat. Living Travel and Internat. Living
Other blogs I contribute to:
Milos Blog (US) Milos Blog (US)
VFPConv. Dev Blog (US) VFPConv. Dev Blog (US)
VFPConv. Dev Blog (DE) VFPConv. Dev Blog (DE)

 

Blog Archives
All Blog Posts

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

 

 

 

This Blog is powered by MilosTM Collaboration Components.