Hi,
When trying to access a site property value, sometimes it gives the error
"Invalid object name 'OSSYS_SITE_PROPERTY_DEFINITION'."
Here's the stack of the error:
The weird thing is that the error doesn't happen all the time, it has a erratic behavior. For example, when using debug the error doesn't occur.
Also, it happens not only in development but also upper environments.
Hi @Leandro Oliveira ,
Yes we got an understanding of the problem and a workaround for it.
Problem:
We have database catalogs and after a BulkInsert (to a different database catalog than the main one) call we are no longer able to access site properties.
It seems (focus on seems) that the BulkInsert extension changes to the database catalog specified and doesn't do the change back to the main one, meaning that when accessing the site properties the catalog is no longer the correct one (main).
Workaround:
The solution found was to get all site properties needed for the logic after the BulkInsert call.
In our case, this didn't compromise the maintainability of the code so this was ok.
Another possible solution that I though but haven't tested to check if it works was to do the BulkInsert in a service action. But this could bring more work managing the database transactions. Not sure if this is suitable for your case.
Hope this helps!
Are you trying to read Site Properties directly from database, instead of just using Site.SomeProperty?
No, I'm using the Site.SomeProperty.
Below one code example code where I'm having the error.
This is odd. There's nothing wrong with this. You should open a support request, tough.
Hi Patrícia, I'm having the same problem.Have you opened a ticket and got a solution? The site property is being accessed the usual way Site.Property.
Regards
Hmm by the description of the problem you mean getting all site properties before calling BulkInsert, right? But the case is, I'm not using BulkInsert, maybe something else is changing the catalog transaction, because we do have multiples catalogs. The weird thing is that both modules (the UI and the one with Site Property) are on the same catalog and no calls to extension methods that change it.
Thanks anyway.
Do you have any other extensions that could, somehow, change the database catalog?
Not found yet, but at least I have a clue now. I'll drop a message if I find a good workaround to this. Thanks Patrícia!
Hi ,
I noticed that you are using a bulk insert.
Maybe the problem is in the Bulk insert component.
If you use it in a expression for exemple , the site property gives the same error?
Hi @Filipe Manteigas ,
I don't think it got anything to do with BulkInsert. The exception is being throw in the moment Site.ProcessBath_DatabaseCatalog is read. You can observe the stack trace too, exception happens before BulkInsert is stacked in the pile.
My case is happening in just using a boolean site property in a If widget, in the middle of flow:
Hello ,
Same problem here, using diferent dbcatalog but when accessing Site.Properties returns "Invalid object name 'OSSYS_SITE_PROPERTY_DEFINITION'". Has outsystems a final solution for this?