Togglz changes FEATURE_ENABLED column in database - togglz

I am using JDBCStateRepository with oracle database. During application startup, togglz disables all features (changes all FEATURE_ENABLED to 0 in database) for all features that don't have #EnabledByDefault.
How can I disable this behavior?
Thanks

Related

How to update the state and schema in Cordapp?

In corda dev mode,
For Example I have created a state with 3 Params, also with Schema for the state.
I have build the project and running it.
Due to the business need to need to 2 more params.
Below are the points I have understood from the corda docs.
Change the state.
Change the schema
Change the contract
Contract and state upgrade flow
I understood the existing states are updated with the new contract constraint.
Will the schema's gets updated by itself during the start of the node by giving {runMigrations=true}
Need help.
Firstly runMigrations property is used only for Corda Enterprise and not for Corda Open Source.
Take a look at the node configs available in enterprise and open source.
https://docs.corda.net/docs/corda-enterprise/4.3/corda-configuration-file.html#database-properties-ref
https://docs.corda.net/docs/corda-os/4.3/corda-configuration-file.html
Performing state upgrades is handled differently in open source and enterprise.
In Enterprise version, the tables are created as liquibase tables and liquibase is used to perform autotmatic database migration.
In Open source, liquibase is not used and tables are created as hibernate entities.
To do a state upgrade, you can add the three new params to your state, build the new jar, replace the old jar with the new one, and hibernate will take care of adding these new columns to the table. One more point on this is that even Hibernate advises not to use Hibernate to modify schema/data migration, so I would recommend you to create your own sql script and run it on the database. (This is done automatically by liquibase in the enterprise)
With corda 4 using signature constraints upgrade is easy, replace old jar with new jar(new jar has to be signed with the same signature used fro signing old jar), start the node. So you do not have to do the complex contract upgrade process.

SQLite Database Versioning and Xamarin Config String

I have an Xamarin Android (and maybe someday iOS) app that utilizes a rather sizable SQLite database (20MB+). I am somewhat new to mobile app development and definitely to Xamarin. I need to control database versioning. This is a best-practice question.
Edit/Clarification: Some of the data is app/user created or maintained. Some of the data is generated via a 3rd party and is read only, in 2nd and 3rd normal form. That data must be updated with version release. Also, the user will purchase some of these data sets in-app.
My Plan:
Everytime the app opens - OnStart (), I will validate the version of the database that is supposed to exist via a configuration string against a table value in the SQLite database with version info. If the versions don't match, the database file will be copied from the APK/assets to a local folder on the device, overwriting the existing file. I definitely don't want this to happen everytime the app opens for many reasons.
3-part question:
First, is this solution a solid approach without major road blocks? Where in Xamarin (or Android project) is best to store the database version string? And finally, is there a 3rd party library (preferably nuget) which already handles database versioning? I cannot find anything like that for .NET / Xamarin. Only some Java libraries which are more Android specific.

Asp.Net Mvc 4 and Entity framework 5 code first database migration

I created an internet asp.net Mvc 4 application. It used EF5 code first, LocalDB by default. I have the following issues. I put all my tables in data context class MyContext and enabled database migration on it.
UsersContext. I added a field email in the table UserProfile. However, I cannot enable database migration on the default UsersContext since I already enabled migration on MyContext. I had to delete the database and let it recreate UserProfile table (I had to open the user register page first, otherwise it will create UserProfile without field email.)
I published the project to a server with IIS/Sql Server and keep working on the project. However, from time to time it shows the model of UsersContext were changed (not true) and I had to delete the database on the live server and let it recreate the database.
Sometimes it create the same index twice on a table in MyContext and it failed the migration. And I had to delete the database again for recreating.
How to prevent the above issues? Should database migration be disabled after go live? How to apply the Model/DB changes?

Managing coredata/sqlite database lifecycle in iOS project

I'm writing an ios app which browses(read only) a sqllite db. As the project evolves, the the db entities will change (add/modify attributes). Presumably I should get xcode to rebuild the "Managed Object class" when this happens, is that all I need to do? What about the database? How do I transition the data to the new data model?
From what I know, there is no way for you to control the structure of a Core Data database. Because CoreData gives you a lot of goodies - the visual object design and mapping - it needs to control the database's structure and content. That means that loading your own SQLite database and having CoreData manipulate it is impossible. You need to have core data load, manage, store all the data that is there. Core Data is ideal if it manages local data for the app, not when it needs to load a new database it did not create. For those instances, use either the native C layer of SQLite or a library like FMDB.

ASP.NET Dynamic Data Running as Read-Only?

I've created a new ASP.NET Dynamic Data website and have used LINQ-to-SQL for the framework. I start up the application and it displays my tables fine and I can browse them - but it doesn't give me any create/update/delete abilities - all I can do is read? I didn't change anything from the defaults - what gives?
This happens when you don't have the primary keys set in your database.

Resources