Skip to main content

Posts

Showing posts from 2017

Using multiple Authentication Schemes for your APEX application

Recently someone asked me how he could implement multiple authentication schemes for his APEX application. He would like to use (some kind of) Single Sign-on authentication and - as an alternative - an Application Express Authentication. The problem is ... you can only define one Authentication Scheme being "Current" for an application! So how can we solve this issue? First, we need te be aware that multiple applications can share their authentication by using the same cookie. Thus if you specify "MYCOOKIE" as the Cookie Name in Application A as well as in Application B, you can switch from A to B and back without the need of logging in again. It doesn't matter what Authentication Scheme Type you are using! Knowing this, we are halfway our solution. We need two Applications. One - the "real" application - using the Application Express Authentication, let's name this one "LAUNCHPAD". And another one using the Single Sign-on Authenticat

Dockerize your APEX development environment

Nowadays Docker is everywhere. It is one of the main components of Continuous Integration / Continuous Development environments. That alone indicates Docker has to be seen more as a Software Delivery Platform than as a replacement of a virtual machine. However ... If you are running an Oracle database using Docker on your local machine to develop some APEX application, you will probably not move that container is a whole to test and production environments. Because in that case you would not only deliver a new APEX application to the production environment - which is a good thing - but also overwrite the data in production with the data from your development environment. And that won't make your users very excited. So in this set up you will be using Docker as a replacement of a Virtual Machine and not as a Delivery Platform. And that's exactly the way Martin is using it as he described in this recent blog post . It is an ideal way to get up and running with an Oracle d

Refresh selected row(s) in an Interactive Grid

In my previous post I blogged about pushing changed rows from the dabatase into an Interactive Grid . The use case I'll cover right here is probably more common - and therefore more useful! Until we had the IG, we showed the data in a report (Interactive or Classic). Changes to the data where made by popping up a form page, making changes, saving and refreshing the report upon closing the dialog. Or by clicking an icon / button / link in your report that makes some changes to the data (like changing a status) and ... refresh the report.  That all works fine, but the downsides are: The whole dataset is returned from the server to the client - again and again. And if your pagination size is large, that does lead to more and more network traffic, more interpretation by the browser and more waiting time for the end user. The "current record" might be out of focus after the refresh, especially by larger pagination sizes, as the first rows will be shown. Or (even wors

Push changed rows to an Interactive Grid

For pushing changes from the database to the end user, the regular solution is using websockets. A change in a record is detected - using a trigger or using the CQN (Change Query Notification) feature - and a notification is send to a websocket server. That websocket server broadcasts the notification over a channel to all browsers that are tuned in to that websocket channel. Then the browser reacts to that notification, usually showing an alert or refreshing a report. This trick is described on multiple sites, just Google for " oracle apex websockets " or similar. So back in the old days, we used that notification in the browser to refresh the (interactive) report. But along comes the Interactive Grid (IG) . While he full-refresh mechanism still works for IG, an IG has also the option to refresh just one row.  So wouldn't it be awesome that just the changed row(s) get refreshed upon a change in the database, instead of the whole report? Can we do it ... yes we ca

A review of APEX World 2017 - Day 2

(You can read my impression of the first day here ) After a short but good night sleep and an excellent breakfast, Mike Hichwa delivered his second keynote " RAD Challenge: Build a Real World application in 60 minutes ”. Although he suffered from connection issues, Mike managed to wow the audience showing the new packaged app "Quick SQL” and  the new (currently Cloud-only) “Blueprint” option to create a new application. As JSON is not code (but just a collection of value-attribute pairs), it was really a  no-code showcase! Then it was parallel session time again and I went to see how Christian Rokitta would "Bootstrapify Universal Theme” . The message is: You don’t have to unsubscribe from the Universal Theme (and please don’t!) to create an application that looks totally different from the “regular” APEX applications. Then I had to deliver my second presentation “ Docker for Dummies ”. It was aimed at people who might have heard of Docker but really h

A review of APEX World 2017 - Day 1

Last week the SS Rotterdam was the beautiful location of the largest gathering of APEX Developers worldwide. With around 380 (!) attendees a new high was set. And they came from all over the world : I spotted people from The Netherlands, Belgium, Switzerland, Austria, Croatia, Germany, Denmark, Norway, UK, Ireland and the USA. And I even might have missed one or two …. The event started with a presentation by the “father of APEX”, Mike Hichwa, talking about " Oracle APEX Past, Present and Future ”. Of course everyone is curious what the APEX future might bring: Friendly URL’s, automated testing, more JSON, concurrent APEX versions, third party Oauth 2 authentication (think Facebook, Google), APEX app diff and more, a lot more, REST capabilities. And now we have to wait for APEX 5.2 … and that might take a while!  After this keynote, the conference split up in three tracks. After the coffee break I returned to to big theatre where Geertjan Wielenga talked about &qu

EECS - Oracle Exadate Express Cloud Service, Step 4 : APEX !

So what are my experiences using EECS doing some APEX work? First of all, it is not blazing fast. Probably caused by the latency (as mentioned in my previous post). It is not slow, it is just ok('ish).  Second, and way more important, it runs APEX 5.0.4 ! So whatever Oracle advertises about " Cloud first " ... it doesn't seem to apply to APEX (or APEX on EECS). So this fact alone makes this environment useless for demo, development and presentation purposes at this moment. I heard through the grapevine that 5.1 will be available from April 25 - but that's still a month away. And that rumour could be false. Third, because you don't have access to a SYS account, you can't install something like APEX-SERT . Maybe the install scripts can be adapted for the PDB_ADMIN account - I haven't looked into that yet. Four : As mentioned in an earlier post, within an EECS PDB instance you get one and only one APEX Workspace. You can't add one (no

EECS - Oracle Exadate Express Cloud Service, Step 3

Once you have defined your users for your Express Cloud Service, all users with the role of Database Developer or higher can access the database Service Console. From here all database related actions can be started. The upper category, Web Access, brings you to the specified part of the APEX builder - more on that in the next post. In the lower category you can create database schema's. For our goal within smart4apex, I created a schema for every developer. You can define whether the schema should be accessible from within APEX and creating an separate tablespace is optional. I haven't played around with the Document Store yet, so I have to skip that part. You can also set the password of the administrator of your PDB - the most privileged user within your PDB you have access to. Franck Pachot did an excellent writeup about the privileges of that user. I hoped the "Manage Application Express" would bring me to the "APEX Admin" environment - a.k.a.

EECS - Oracle Exadata Express Cloud Service, Step 2

Once you get your services up and running, you can log into your domain - in this screenhot "smart4apex" - on the Oracle Cloud. Then you'll end up in the "My Services" dashboard. As I have only one, my dashboard looks quite clean, showing just this widget: Just a few remarks for the designers of this: I am very curious why there is an extra " (Number of ..."  in the chart title. The same superflous text is also on another location on that page. And, more intriguing, what would "0.0323 database instances" mean? 1/0.0323 = 31. So something like days? But February has 28 days... It would make way more sense to just show here how many instances I had on those day (so, "1" al over the place...). From this widget you can drill into the "Service Details", where you can set rules and alerts and see the (historical) status of your instance. Funny thing is, I noticed this: These figures indicate, I have a storage limit

Intermittent ORA-06502 error when running APEX 5 on 12c

We upgraded our environment from 11.2 to 12c last week. This week we noticed an error in one of our APEX pages, a rather simple form for entering data. Nothing fancy, nothing spectacular - only a spectacular error when you tried to edit a record.  Running the page in debug mode (even on LEVEL9) wasn't very helpful as you can see below (10 points who immediately spots the error!). The error didn't occur for all records. It seems that a long(er) Code and Description field on the page resulted in an error more frequently. Also fiddling with a couple of the checkbox fields on the page had an effect. So I asked Twitter for help. And within a few minutes I got all kinds of tips and advice. But especially one, from Peter Raganitsch  was spot on. He suggested, looking at the debug output above, to take a look at the #CLOSE# position in the template. . My buttons are positioned in that #CLOSE# position, so I took a closer look at those. There were three that passed the Id, Cod

First steps using the Oracle Exadata Express Cloud Service

The Oracle Exadata Express Cloud Service was announced at Oracle Open World 2016. This service looks like an excellent use case for Oracle Database development purposes as well as setting up a test environment. And even for small to medium sized production situations it looks very promising as you can see in the table below. Especially the cheapest option offers a lot of bang for your bucks. But alas, this service was not as widely available as I expected. The first months it was US-only and you could only figure out by ordering the service and then you would find out on the last page that you should "contact your Oracle sales rep". I sincerely doubt whether he or she could provide you with that service, so I just waited until it would be more generally available. And since a few weeks the Oracle Exadata Express Cloud Service is also available in Europe - I don't know about other parts of the world. A missed chance though that Oracle didn't announce that proper