Change the site Property value at runtime.

Change the site Property value at runtime.

  

Hi everyone,

 can we change the site property value at run time.



Thanks

Rajendra Singh

Hi Rajendra,

We have "OSSYS_SITE_PROPERTY" table where we can modify PROPERTY VALUE at runtime. 

Hope this will help.

Thanks,

-HM- 

Hi Rajendra,

Yes, you can change a site property the same way as any other variable and session variable.
But it is not advisable to do that. It's not the idea of the site property and Kilian explained very well why you shouldn't do this in this post: 

http://www.outsystems.com/forums/discussion/27096/how-to-change-site-property-value-in-ui/

Cheers,

Eduardo Jauch

Hi Rajendra,


What was wrong with what you shown in the screenshot?

Technically nothing would prevent you from do it that way. But I'm not really a fan of using site properties as control state of the application. They are initially designed to be used as configurations. 

Site properties don't have strict ACID properties, so they are prone to some inconsistency if you multiple readers/writers. For flow control purposes I think you should use an entity instead.


Regards,
João Rosado

hitesh maran wrote:

Hi Rajendra,

We have "OSSYS_SITE_PROPERTY" table where we can modify PROPERTY VALUE at runtime. 

Hope this will help.

Thanks,

-HM- 

Thanks Hitesh,

 i don't want to hit the database because of the performance issue, i am looking for global variable.



Thanks

Rajendra Singh


Eduardo Jauch wrote:

Hi Rajendra,

Yes, you can change a site property the same way as any other variable and session variable.
But it is not advisable to do that. It's not the idea of the site property and Kilian explained very well why you shouldn't do this in this post: 

http://www.outsystems.com/forums/discussion/27096/how-to-change-site-property-value-in-ui/

Cheers,

Eduardo Jauch

Thanks Eduardo Jauch, 

                                        As per my requirement i have to use the site property or  store the data into the database. if both will take the same time then i will go for the site property. because in case of site property i just have to assign the value, and if i will store the value into the database, i will write at least two query to check and change the value.

But Problem is i am not able to change the value by assigning.

 



Thanks

Rajendra Singh


Solution

Rajendra koranga wrote:

Eduardo Jauch wrote:

Hi Rajendra,

Yes, you can change a site property the same way as any other variable and session variable.
But it is not advisable to do that. It's not the idea of the site property and Kilian explained very well why you shouldn't do this in this post: 

http://www.outsystems.com/forums/discussion/27096/how-to-change-site-property-value-in-ui/

Cheers,

Eduardo Jauch

Thanks Eduardo Jauch, 

                                        As per my requirement i have to use the site property or  store the data into the database. if both will take the same time then i will go for the site property. because in case of site property i just have to assign the value, and if i will store the value into the database, i will write at least two query to check and change the value.

But Problem is i am not able to change the value by assigning.

 



Thanks

Rajendra Singh



Hi,

You say you can't assign the value to a site property. What is happening? Are you getting an error in run time? The value is not being assigned? You get a design time error and can't publish?

Cheers,
Eduardo Jauch

Solution

João Rosado wrote:

Hi Rajendra,


What was wrong with what you shown in the screenshot?

Technically nothing would prevent you from do it that way. But I'm not really a fan of using site properties as control state of the application. They are initially designed to be used as configurations. 

Site properties don't have strict ACID properties, so they are prone to some inconsistency if you multiple readers/writers. For flow control purposes I think you should use an entity instead.


Regards,
João Rosado

Thanks João Rosado,

                                   i have created a site property and in preparation of a page trying to  assign the site property value. while debugging its showing blank.


Thanks

Rajendra Singh

Hi Rajendra,

Are you using the site property to control if a table is being updated to prevent other users from doing changes at the same time?

If it is this, why don't you use the Get<TableName>ForUpdate entity action?
It will make this work much smoother than trying to do this server side...

Cheers,

Eduardo Jauch

Thanks Every one, 

i think something is wrong in my page.

Eduardo Jauch wrote:

Hi Rajendra,

Are you using the site property to control if a table is being updated to prevent other users from doing changes at the same time?

If it is this, why don't you use the Get<TableName>ForUpdate entity action?
It will make this work much smoother than trying to do this server side...

Cheers,

Eduardo Jauch

 thanks..

You are right Eduardo Jauch i am trying to do the same, but in my case i don't have the id to update. 

My i know i can i use the same action in my scenario.


Thanks

Rajendra Singh


Hi Rajendra,

An update require the ID. It must be present in the record you are providing.
If you are using the Update<Table>.

If you are doing a bulk update using an Advanced Query, I'm not sure, but I "think" you will have to take care of this locking by yourself, probably starting explicitly a transaction, inside the advanced query, defining the isolation method to handle this, and commit at the end of the operation.

But I never did that and don't know the consequences to the already started Transaction when you called the screen action and error handling.

Cheers,
Eduardo Jauch 

Eduardo Jauch wrote:

Hi Rajendra,

An update require the ID. It must be present in the record you are providing.
If you are using the Update<Table>.

If you are doing a bulk update using an Advanced Query, I'm not sure, but I "think" you will have to take care of this locking by yourself, probably starting explicitly a transaction, inside the advanced query, defining the isolation method to handle this, and commit at the end of the operation.

But I never did that and don't know the consequences to the already started Transaction when you called the screen action and error handling.

Cheers,
Eduardo Jauch 

Thanks a lot Eduardo Jauch, I need to check why i am not able to assign the site property.


Rajendra,

What's the purpose of this site property?

Also, what is the version of your server (and Service Studio), and is .Net or Java?
In my personal environment, I can change the value in runtime without problem:

Before the assign:

After the Assign:

Cheers,
Eduardo Jauch

This is a REALLY BAD IDEA.


1. Assigning a Site Property frequently causes VERY POOR PERFORMANCE because of the cache invalidation.

2. It is STILL going to write to the database (site properties are stored in the database). So even if writing to Site Properties did not invalidate the cache and cause big performance slowdowns, this is still not saving any time.

Make an Entity for this and write it the proper way.

J.Ja

While I totally agree with you, Justin, I think its important to understand what he is trying to accomplish using the site property, because if it is some kind of "locking" system, it mostly will fail its purpose, using a site property or an entity.

I also want to point out, that this code will make the Site Property value infinitely long, which will also have problems of its own.

J.Ja