Michel Levy
|
|
Group: StrataFrame Users
Posts: 193,
Visits: 9K
|
Still learning StrataFrame... I can't figure out how to localize the StrataFrame collision form and how I could put it on top Myform.TopMost = True and Myform.MyBrowseDialog.ForceWindowTopMost = True, so collision form is always on bottom
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
Well, you should probably create your own collision form to have complete control. The ConcurrencyException event arguments give you everything that you need, so you would just need to display it to your end-user. At this point youa re 100% in control and can implement localization just like you would on any other form. Let me know if I am missing something.
|
|
|
Michel Levy
|
|
Group: StrataFrame Users
Posts: 193,
Visits: 9K
|
Trent, Yes, I've seen I could create my own collision form, and it's probably what I'll do for my own applications. But is it possible to basically "manage" the collision form provided by StrataFrame (top/bottom or showdialog option, and localization)? It would be a nice functionality for a few customers and french VFP users looking for rapid migration solutions.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
At the moment, no. But you are correct in that it should probably be localized. We will take a look at this. But for now, you can create your own to get around the issue. Sorry.
|
|
|
Michel Levy
|
|
Group: StrataFrame Users
Posts: 193,
Visits: 9K
|
Don't worry, Trent! I've bought StrataFrame as a framework, not as a wizard ; I'll create my own collision form, and come back soon with other questions.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
Sounds good. We look forward to working with you
|
|
|
Michel Levy
|
|
Group: StrataFrame Users
Posts: 193,
Visits: 9K
|
Hi, I'm now creating my own collision form, so I'm working with ConcurrencyException; seems quite easy to manage for collision on update, but I've not found how to do for delete. say Table1 "cuves" with a cuve_pk autointeger, a field numcuve C(15) unique, and a field qtstock integer user A is loading dataset from cuves using a BO in a "StrataFrame built" application, and navigates to line n user B is updating numcuve or qtstock on the same line n from within an other application user A calls delete on that line n
Delete is not committed on server, but there is no collision in concurrencyexception (DeleteConcurrencyType is set to OptimisticAllFields) Why? how to do? where?
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Is the event being raised and there is nothing in the event args, or is the collision not being detected? If the collision is not being detected, you can always turn on Debugging for the data source (MicroFour.StrataFrame.Data.DataBasics.DataSources("").SetDebugOn()) and check the command that is being executed to make sure that it would be albe to find the collision.
|
|
|
Michel Levy
|
|
Group: StrataFrame Users
Posts: 193,
Visits: 9K
|
Thanks Ben, I begin to understand... here is the SQL command really sent by the BO (concurrency mode set on allfields, so all the additional WHERE clauses are correct):
DELETE FROM [dbo].[cuves] WHERE [cuve_pk] = @cuve_pk AND (([numcuve] = @numcuve_ORG) OR ((@numcuve_ORG IS NULL) AND ([numcuve] IS NULL))) AND (([qtestock] = @qtestock_ORG) OR ((@qtestock_ORG IS NULL) AND ([qtestock] IS NULL))) AND (([volumax] = @volumax_ORG) OR ((@volumax_ORG IS NULL) AND ([volumax] IS NULL))) AND (([dispo] = @dispo_ORG) OR ((@dispo_ORG IS NULL) AND ([dispo] IS NULL))) AND (([directe] = @directe_ORG) OR ((@directe_ORG IS NULL) AND ([directe] IS NULL))); @volumax_ORG was 10 on A client side when BO was filled, and User B upadated its related field to 100 before A asked for deletion. So my SQL command would never raise an exception, since there was no line matching on the server! I totally misunderstood the purpose of DeleteConcurrencyType, wich is only to add the additional where clauses, right? How could I retrieve the result of the delete command (boolean or #line deleted) without writing a specific procedure? Or is it a better practice to create a property "is_deletabled" on my BO class, and to check in beforedelete method to switch that property to True or False, so it could be retrieved by beforedelete methode on UI layer?
and the SetDebugOn is really a very nice tool
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
@volumax_ORG was 10 on A client side when BO was filled, and User B upadated its related field to 100 before A asked for deletion. So my SQL command would never raise an exception, since there was no line matching on the server! Hrm. That is very odd. The addition of the extra parts to the WHERE clause will prevent the line from being deleted (just like it should), however, it should be raising an concurrency exception. Looking at the source code, if the local line is deleted, it will raise the ConcurrencyException just like normal. Just out of curiosity, are you expecting to wrap the Save() in a Try/Catch or are you handling the ConcurrencyException event of the business object?
|
|
|