Collision Form


Author
Message
Michel Levy
Michel Levy
StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Ermmahem..

If you have the SF source code built in debug, then put a break point in ...

Ben, don't forget I'm an absolute beginner in .NET, so I don't know how to put this breakpoint in SF sourcecode in my project Unsure

Could you advise please, I'm lost now and here
Thanks

Michel

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you have the SF source code built in debug, then put a break point in the DataLayer.vb file (in the MicroFour StrataFrame Business project in the Data folder) somewhere around line 1120 on the HandleConcurrencyException method.  This method will be called when the server returns 0 for the number of records affected by the delete.  You can see what it's doing by stepping through it.
Michel Levy
Michel Levy
StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Ben,

I'm handling it in the ConcurrencyException event of the BO. Never raised...

Local line is deleted in BO, not on server (I can see it by loading another instance of the same MaintenanceForm).

How could I debug that? where should I put a breakpoint?

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
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?

Michel Levy
Michel Levy
StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)
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 Smile

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
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
Michel Levy
StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)
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?

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Sounds good.  We look forward to working with you Smile
Michel Levy
Michel Levy
StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)StrataFrame User (437 reputation)
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
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
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. Ermm
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search