A beacon is a Bluetooth Low Energy device including some information in its advertising data.
Working with beacons requires code to read the beacons and some setup to ensure you read only the right beacons, especially as more and more are appearing! This article mainly focuses on the latter and what you should be aware of before you deploy your beacons.
With RAD Studio XE8 there have been a number of database updates to expand connectivity, and improve and introduce functionality for us programmers.
FireDAC & IBX support for Change Views
FireDAC has introduced new support for Change Views – enabling rapid identification of what has changed on the server side data and updating of client side stored data. See this <2min video for how these work.
Source code for the example ships in the samples directory:
Marco Cantu mentioned on the Launch webinar Q&A a customer was claiming seen a speed up of around 25% on a TClientDataSet application due to the refactoring at the base of how TField is used at the core layer. 🙂 This is really cool for both VCL and also FMX developers.
64bit support for iOS
With the new platform for iOS 64bit, the database layer is also seamlessly available, just recompile and run 🙂
Other updates
There are updates for EMS including push notification. EMS is a great way to access central data from mobile devices. EMS now is updated to include InterBase XE7 for both the server and ToGo side, allowing you to use Change Views on both Server and Clients.
Where FireDAC uses SQLite, it has been updated to a newer driver.
I started this app using components that was introduced in XE7 – AppTethering and Multi-View, and these have been great, but I have benefited recently from the new FireUI updates in building a version for multiple screens. I now have it running on Tablets, Phones and Android TV. (which is kind of fun).
I’ve found you get some good analytics about platform and country etc from Google App Store, which is cool, but I want some in app details to know when its being used. – This is especially cool as this can be used in VCL and FireMonkey applications and there is a free version of the service with the option to purchase enhanced online analytics.
More Native Controls
I’m also going to look to increase the native controls used in the app with the new options for a number of the controls I have used (like the slider and list view). I like the way FireMonkey abstracts this as an option and even surfaces some new options in this area.
For more about the new controls and everything else that is new in XE8 please visit the online help documentation.
InterBase XE7, update 1 went live on Friday and brings with it SQL language enhancements for Change View, and some updates to IBConsole and the availability of InterBase ToGo for XE7
Full details about the update are available on the InterBase DocWiki
Change View Updates
There are 2 major additions to InterBase Change Views in Update 1
Prior to update 1 you had to manually drop a subscription via an SQL statement. This was a temporary solution and has now been replaced with the correct SQL syntax
DROP SUBSCRIPTION <subscription name> [RESTRICT| CASCADE]
If you want to remove a subscription that has subscribers you must use the CASCADE command as RESTRICT is the default.
Change View SQL Extensions
InterBase SQL now includes additional language to support querying about the changed state of specific fields via the <FIELD> IS [NOT] {CHANGED | INSERTED | UPDATED | DELETED} clause.
Take the following example. Lets imagine we have two employee records that have been modified.
EMP_NO 39 has their DEPT_NO changed
EMP_NO 109 has their SALARY changed.
At run time you want to select only those that have had a SALARY change prior to processing staff payments. To achieve this first, a Change View subscription is set active (making any SQL statement subsequently run only return the delta for that subscriber). Then SQL where clause then filters further where the SALARY IS UPDATED.
SET SUBSCRIPTION sub_employee_changes at 'MyDeviceID' ACTIVE;
SELECT EMP_NO, DEPT_NO, SALARY FROM EMPLOYEE WHERE SALARY IS UPDATED;
EMP_NO DEPT_NO SALARY
-------- ---------- ----------10960075000
Regardless of what you select, the commit will still bring
InterBase IBConsole Updates
InterBase IBConsole has a number of new features, introduced in Update 1 designed to get you started quicker.
When you open IBConsole now you find the new InterBase – Start Here page as a tab at the top of the screen. The start here page includes containing details about Community and featured posts, as well as training videos and direct links to the documentation. While an offline page ships with IBConsole, If you want to see this page now, please visit http://www.embarcadero.com/starthere/interbase/index.html
Having this page online allows us to improve our communication with our customers about critical information and appropriate news.
Recent Databases
There is also a new feature in the bottom left of the screen (see image above or below) enabling you to quickly connect back to the recent database you have been working on.
This windows shows you the database name, server and also the when you last accessed the database via IBConsole.
Change Views
IBConsole also now includes access to work with subscriptions.
InterBase ToGo XE7
InterBase XE7 ToGo trial edition is now available for download – more details to come soon about ToGo.
This week I hosted a Skill Sprints session looking at InterBase Change Views with an example set of code working around a Pharmacy needing to keep centralised drug information updated at distributed pharmacies.
The example code will ship with the next major release of the RAD Studio products – which you can get for free with the current RAD offer
This InterBase Change Views Example demo shows off this powerful way to track on the server what data is changing in a very lightweight and scalable way.
This Skill Sprint Video for InterBase Change Views follows on from the recent blog posts I have done on Change Views which are available here:
Last week CodeRage III Brazil ran with a host of great sessions in Portuguese, covering RTTI, App Tethering, DataSnap and FireDAC and also InterBase. Back in December I hosted the product Launch of InterBase XE7 at CodeRage 9, and it has been great working with Dormevilly and Fernando to get an updated Brazilian Portuguese version done, including some of the great capabilities we have today with Change Views. Great job guys 🙂
A common question for a developer is how to store data. While file formats like INI files. XML, CSV etc provide a simple way to store data, they are often not secure enough or provide enough features for most applications. This is when a data store is required. One such option is an embedded database.
What is an embedded database?
An Embedded database is one that can be deployed inside or along side you application. They are called embedded as they can be silently deployed / installed to provide database support without the need of a separate admin intensive process. Embedded databases should be fast, have a small foot print, provide admin free capabilities all at the same time as providing full features SQL capabilities. Unfortunately, not all embedded databases provide complete capabilities, InterBase however is very feature rich in all editions. For more about Embedded databases and the different types they come in, watch the short video below.
I was recently asked how to connect to InterBase from Visual Studio, and while its not something I have done before, luckily I know a man who has. – Thanks to Gabe Goldfield for checking the example below with InterBase XE7 and Visual Studio 2013 Ultimate.
Connecting to InterBase from Visual Studio
InterBase currently supports an ADO.Net driver that works with InterBase XE, XE3 and XE7 providing both 32bit and 64bit support. Full details here.
In Part 1 I explored the concept of change views, before how to create a Change View ready for use in Part 2. In Part 3 we are going to explore how to use a Change View to collect data that has changed in your subscription.
Using an InterBase Change View to fetch data deltas
The following steps are the high level overview of using a Change View.
Start a Transaction in SnapShot isolation mode.
Set the Subscription active
Run your select statement to fetch you delta
Once you have collected the delta commit your transaction to bring your Change View up to date.
SnapShot Mode
OK a bit of background as we all love to know how things work..
InterBase is powered by a multi-generational architecture which is exceptionally useful when data integrity is important. imagine you need to run multiple financial reports while the system is live; Imagine a connection drops part way through a big data change how do you know what has changed? Multi-generational architectures and transactions makes this possible.
Using a transaction set to SnapShot mode we have a stable point in time that means even if records are updated at the same time as your transaction, they are not missed. When you start your next transaction you will locate those concurrently made changes! – imagine trying to do that with date time stamp tracking!
This means you can have multiple users updating the data at the same time safely without having to lock the tables 🙂
Setting the subscription active
At this point, lets pretend we have a STOCK table and we run the following statement
Select * from STOCK
the data returned would be all the STOCK records.
How do we get from here to just getting changed data deltas? Well, first we need to activate the subscription and provide an ID that we are going to track against.
set subscription sub_stock at 'DeviceID' active;
With the subscription “sub_stock” active, running the initial statement will again return all records as its the first time data has been requested in the subscription.
At this point there are two possible next steps: Commit or Rollback.
Rollback of the transaction will ensure the data is provided again, Commit will bring the Subscription up to date for the start of the transaction.
Running the Select statement again in an active transaction with the subscription active will now return only delta’s
Preventing you data changes showing in your Change View delta
So we have covered selecting data, but what about updating data? How do you stop the changes to data you make appearing in your subscription yet still available to others? Well simply, make the changes while your subscription is active.
Start a Transaction in SnapShot isolation mode.
Set the Subscription active (using your ID)
Run your update statement to modify the data
Commit your transaction.
Simples!
Introduction to Change Views Video on Embarcadero website
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptRead More
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.