elegant
Oct 17, 2017

Record Locking

3 comments

Hi

I notice in your save (modify) procedures you don't do any explicit record locking. Is this because you're re-reading the record within the transaction frame and you're using HTransactionCommitted and it's therefore not necessary? There also doesn't appear to be any error checking for locks; is that not necessary either or have I missed something?

 

Thanks

David

Steven Sitas
Oct 19, 2017

Hi David,

Sorry for the delay in answering your post, but we are preparing a new version and the Hospitality module and seems like we "forgot" your post ...

 

Yes, as you said in your post, everything is taken care by the transaction frame.

We don't use any type of explicit record locking in the project - we leave all locking (and the error handling) to the transaction frame - and this depends on the RDBMs. This way we don't have to worry about any compatibility issues (or non supported features) between HFSQL C/S and other RDBMs (like MySQL, SQL Server etc.)

 

Just note that for transactions and the HFSQL C/S engine the ISOLATION mode is also VERY important.

Take a look here: https://help.windev.com/en-US/?1000020926&name=HTransactionIsolation

The current alpha360 implementation supports hReadCommitted and hReadUncommitted.

We are doing some test so we can include support for hRepeatableRead in the future.

 

* There are a few places in the current implementation where editing (not adding or deleting) is done DIRECTLY by WX tables. Here we don't use transactions (or any kind of explicit locking) but since "editing" here CANNOT touch Primary or Foreign Keys the technique works OK.

In the future these places will be transformed to complete forms also.

 

elegant
Oct 21, 2017

Thanks Steven. When you say the Isolation mode is very important, what exactly do you mean? I understand what the different modes do but how does using one over the other impact on the programming? I've had a look at your code to modify records & can't see that you change anything for the different modes you currently support.

 

David

Steven Sitas
Oct 21, 2017

Hi David,

in the features of the current implementation (OpenSource and Commercial versions with HFSQL C/S or Classic) there is NO need to do any type of different programming for the isolation modes, in the MODIFY code.

Thats because: "The record used is locked in write mode until the transaction is validated or canceled".

https://help.windev.com/en-US/?3044335

 

Things become interesting when you READ or QUERY a file ...

You will see how we handle the different modes in Reports and Queries, starting with v1.13

 

* Just note, that with the introduction of support for MySQL (or MariaDB) we will include an INTERNAL transaction manager to HIDE the differences between the RDBMs and support the BEST features for every RDBMS engine.

New Posts
  • Admin
    Sep 11, 2018

    Hello, It would be great to have a complete comparison chart showing as to what is available in which version of alphi360. Where can we find this comparison? Yogi Yang
  • Admin
    Sep 1, 2018

    Hello, This is just a suggestion to build two Procudures/Functions that would allow a user to read a value from one single field and write/update value one single field. Where it can be useful. For example when a user is creating an invoice and the user selects a product/item and we need to fetch its price (only nothing else) from another table generally will have to create a query for this particular operation or write a set of hreadseek, etc. Instead of that it would be better to call a procedure that would fetch the required value from any table thrown to it. According to me the parameters of such a Procedure/Function would be for example: GetAnyFieldValue(sTableName is String, sFieldName is String, sWhereClause is String) Here one has to give name of table from which data has to be fetched and field name whose value needs to be fetched and the where clause is just that the criteria according to which data is fetched. One condition here should that the where clause should only return one single record but if the number of records returned are more than one we have to fetch the value from the first row and return it, ignoring the rest. Again just my thoughts.... Yogi Yang
  • Admin
    Oct 16, 2018

    Hello, I have watched all your videos but I am specifically writing here regarding this video: https://sites.google.com/computerplus.gr/alpha360erp-wx/windev-implementation/elements-of-the-ui-win In this video I observed that every time we assign Window/Form names to the Dynamic structure we tend to write the name of Internal Window as string. Instead of that can't we use Window's name followed by ..Name. Like for example: IWB_Asset..Name. Coding like this has its advantages. One is that if for any reason we need to rename a window (for any of the million reasons) all that we have to do is rename the window and immediately the Refraction feature of WD will kick in and offer to rename all occurrences in code with the new name. Otherwise what we have to do is find each occurrence and replace it manually. Just my thoughts. Yogi Yang

computerplus

Leoforos Dodonis 43,  45221

IOANNINA - GREECE

Registered VAT ID: EL084190121

sales@computerplus.gr