I am working on a Springboot project which needs a database listener that listens to any change made to a table in Oracle database (12c).
Oracle's Database Change Notification (DCN) seems to be the perfect solution.
But a quick research concluded that Oracle 12c (which we are using) doesn't support Database Change Notification (DCN). The Database Registration seems to be working as we can print the table being registered for listening.
But the onDatabaseChangeNotification method of the class implementing DatabaseChangeListener interface isn't being called when the table is updated.
Why should we not upgrade to Oracle 12c……YET
There are other restrictions in the requirement - No manually created threads, no triggers in DB are used.
I have used example shown in this Oracle guide. (minus the synchronization part and thread creation in onDatabaseChangeNotification method of listener class)==>
Database Change Notification
Is there any working alternative to this?.
Related
I have an Xamarin cross platform application. I am currently storing my data in a Sqlite Database. However we want to have bi-directional syncing with an Azure Sql Database. After much reading I decided to give Dotmim Sync a try. The initial sync worked, however when adding a column to a table and attempting to migrate the data (following the tutorial), I got an error stating that the tracking table was missing. I redid everything again and realized that the entity tracking table was never created and I am not sure why. However Sql created a tracking table but it was not the entity tracking table that the error stated was missing.
I am curious if anyone with Xamarin has been able to successfully create bi-directional syncing with Sqlite and Azure Sql using Dotmim Sync. I have yet to find anything else that will work. Other than hand jamming it in this tutorial: https://www.xamarinhelp.com/mobile-database-bi-directional-synchronization-rest-api/
I am not against that, just seems like a lot of room for error. I am hoping someone out there has had success with what I am trying to do.
Hello I'm using Dotmim sync to synchronize a Sql Server database with a Sqlite database hotsted in a xamarin forms application through an API.
I think that I had the same problem as yours.
The problem is, as far as I understood, that the tracking tables are created only on the first sync.
If you change the schema of those tables you will need to call the Deprovision method.
This method will re-create the stored procedures and the triggers with the new database schema.
I'll leave you the link to the docs:
https://dotmimsync.readthedocs.io/Provision.html#provision-deprovision.
We have a table called Guest in an Azure SQL database. We also have a campaign management tool sitting behind an API on the providers cloud.
When a record is created, updated or deleted in the Guest table, we would like to call the API in order to update the campaign management tool with the latest information about the Guest.
Our initial idea was to hook up a database trigger to a C# .NET Azure Function, however, it looks like this is only supported in Cosmos DB.
We would prefer not to have an application running on a scheduled task that periodically checks for changes in the database and sends these changes to the API.
We have also been reading about creating CLR stored procedures but it looks like these are not supported in Azure SQL databases.
Looking forward to hearing ideas & suggestions.
I can think of a few ways to accomplish this.
[Unfortunately CLR is no longer supported in SQL Azure.]
One way is:
Turn Change Data Capture on, on your Guest table.
Create a server-less Azure Function that has a timer trigger. This function would use the CDC to determine what had changed in your table, and call your vendor API accordingly.
The server-less function is relatively lightweight compared to "an application running on a scheduled task".
You can also use Azure Logic Apps for this case.
There are some predefined trigger which helps to trigger
When an item is created
When an item is modified
Then using the Action to call your API
Refer here
This will be the simplest way that you can achieve your usecase.
You will have to migrate to Azure SQL Managed instances which supports CLR and Broker.
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-transact-sql-information#clr
We have an firebird database connected to our access control system and then a separate web app that I developed for our time and attendance using sql server 2005 as the data source.
I wanted to use entity framework to connect to the firebird database to access data like users, transactions, sites, etc. As this method is very complicated getting the connection using firebird .NET provider the other option I have is creating a sort of replication (Mirror) from the firebird database to sql server.
I have done this with a DTS previously (Selecting the data and then inserting it) and it worked fine but had many manual processes involved in getting the data and updates made it difficult.
Is there a simpler way to do this or any suggestions would be appreciated.
Unfortunately you need to track what to replicate at the data level. If you are only pushing it to the MS SQL database you could use a modified timestamp, or a record version field (create a generator, set a trigger to update the version field upon update) to reduce what you select. Another popular option is to update a field to current_transaction, but if you do a restore you will start counting from 0.
If you are sending data both ways it gets more complicated -- you need to have conflict resolution. You could look at something like the Microsoft Sync Framework which can use the methods above.
I would like to find out the best practice for the following scenario: we have a database table created using Entity Framework (code-first). There's a DBContext and a local collection used as cache, corresponding to the data in the table.
We need to find out if and when someone updates the database manually (any CRUD ops) in order to keep the cache in sync with the database at all times. Ops will be accessing the DB and there's no way around it - so it has to be a technical solution and not a BI one. How can this be done?
Thanks.
You could use an SqlDependency Object.
Subscribe to its onChange event and you'll be able to respond when your data changes.
Enable service broker on your database
Grant subscribe query notifications to your asp.net account
I have a wp7 app that uses the local database implemented with linq. I have an external MS-SQL (2008 R2) server. Both databases have the same schema.
I would like to know how to do the following:
Download information from the MS-SQL to the Database into the local DB of the phone. (Can I use some data-binding technique - I have found no links that do this)
If Changes made on the phone (add new record, edit existing record) how can I push changes back to server.
If changes are made to server then push to phone (I know I can use an observer pattern here)
I should also note that the client app is not used always-on access to the internet.
Thanks
There's no magic here.
You will need to create functionality to get updates from the server (probably meaning you need some kind of timestamp on each record, saying when it was last changed so you can query it).
You will need to create the functionality to upload data and update the database on the server (and potentially handle conflicts).
I would either use ODATA to communicate with the server, or plain old WCF/JSON service.
have a look at the Sync Framework Toolkit