November 26, 2007

Forms 11g new features: Events

My DOAG Conference 2007 presentation was "Forms 11g: A look behind the scenes"

The main two new features are: Advanced Queuing and Javascript-API. Today I explain the AQ-technique with Forms-Events.

Events - Interaction with Advanced Queuing

This is the first big new change in Forms Builder since 6 years. We can create Events and assign them to queues. If someone inserts new data in this AQ, the appropriate new trigger WHEN-EVENT-RAISED starts.


Allowed Properties for Events


Event Type : Data Base, User Defined
Subscription Name : AQ-Name (LOV)
Scope : Application, Form
Auto Subscribe : Yes, No
Correlation ID :
View Mode : Browse, Locked, Removed

formsweb.cfg

maxEventWait=1000

The new parameter maxEventWait is important. The value is in milliseconds and means the intervall, in which the AQ's used by forms get refreshed against the database. Without this parameter the form refreshes only, if the user interacts with the runform.

Code-Snippet

BEGIN
:CONTROL.TI_Payload := get_event_object_property ('EV_Default', Event_Payload);
IF upper (:CONTROL.TI_Payload) = 'ATTACH DEBUG' THEN
DEBUG.Attach;
...
END IF;
END;

This example is a remote control for remote debugging. You can insert a command into the queue, which is assigned to the Event EV_DEFAULT and each time, when the payload has the value ATTACH DEBUG a debug-process starts in the forms runtime.

In my Download-Section is a link to my presentation (in german).

November 22, 2007

DOAG Conference 2007

Today was the last day of this years conference. The DOAG (German Oracle User Group) is now 20 years old and so we had some slots in the conference like "Oracle 5.0 New Features)

That was a funny presentation from Dierk Lenz. He used his 20 years old slides and presented us all the new features from the database in 1988.

In the presentation he started a vmWare with DOS 6.22 and SQL*Forms 2



In this presentation we were nearly 200 people ! To have a look on the new Features of Oracle 5.0 :-)

October 01, 2007

Forms Startup (part 1)

This is the first article of a serial. Different methods of enhancing the Forms Startup-Phase are discussed here. In most projects I saw techniques, where the Browser-HTML were changed, so that the user cannot easily close the browser for example.

My first example is from Francois Degrelle. He gave me the tip with a self-hiding Internet Explorer on Forms Startup. The only parameter which has to be changed is the HTMLbodyAttrs in the formsweb.cfg:


HTMLbodyAttrs=onLoad='javascript:self.moveTo(2000,2000)'

After the forms-application-startup the browser-window moves to the x,y-position 2000, 2000. This is far behind the normal range of the visible screen. And so the user thinks, that the Browser closed hisself. The icon in the taskbar is still available, but the Browser didn't went visible, when the user clicks on the task-symbol.

pro:
- the user thinks, that the browser hides hisself
- only the forms-runtime window is visible (in separateFrame=True - mode)

contra:
- the active task of the browser is visible and can't be activated, only closed

this is actually my favorite technique

September 17, 2007

Bigger. taller. better :-)

I played a little bit with the Template-HTML and found better properties for my Blog.

The old width for example was a bit problematic, because sourcecodes were often too long for the small size of the blog. Now I have 50% more space for my snippets :-)

September 13, 2007

Easy logging and debugging in Forms

Each forms-application needs a simple way to log errors and find them. This technique can be used also to debug Forms, Reports and pure PL/SQL.

First create the table, sequence and view to store the logging-information:


CREATE TABLE Logging (
ID NUMBER(8,0) NOT NULL,
SESSION_ID NUMBER(8,0),
INSERT_DATE DATE NOT NULL,
TEXT VARCHAR2(2000) NOT NULL);

CREATE SEQUENCE Logging_SEQ;

CREATE OR REPLACE VIEW V_Logging_desc
(ID, SESSION_ID, INSERT_DATE, TEXT)
AS SELECT ID, SESSION_ID, INSERT_DATE, TEXT
FROM Logging
ORDER BY SESSION_ID DESC, ID DESC;

You need also a package with some functions to start the logging-process

CREATE OR REPLACE PACKAGE PK_DEBUG IS
FUNCTION Debug_allowed RETURN BOOLEAN;
FUNCTION Next_ID RETURN NUMBER;

PROCEDURE Disable;
PROCEDURE Enable;
PROCEDURE Destroy;
PROCEDURE Init (P_Debug_allowed IN BOOLEAN DEFAULT TRUE);
PROCEDURE Write (P_Text IN VARCHAR2,
P_Session_ID IN NUMBER DEFAULT NULL);

G_Debug_allowed BOOLEAN := TRUE;
G_Session_ID NUMBER;
END;
/
CREATE OR REPLACE PACKAGE BODY PK_DEBUG IS
FUNCTION Debug_allowed RETURN BOOLEAN IS
BEGIN
RETURN (G_Debug_allowed);
END;

FUNCTION Next_ID RETURN NUMBER IS
V_ID NUMBER;
BEGIN
SELECT Logging_SEQ.nextval
INTO V_ID
FROM DUAL;
RETURN (V_ID);
END;

PROCEDURE Disable IS
BEGIN
G_Debug_allowed := FALSE;
END;

PROCEDURE Enable IS
BEGIN
G_Debug_allowed := TRUE;
END;

PROCEDURE Destroy IS
BEGIN
Write ('----------------------stopp '
|| to_char (G_Session_ID) || '--');
G_Session_ID := NULL;
END;

PROCEDURE Init (
P_Debug_allowed IN BOOLEAN DEFAULT TRUE) IS
BEGIN
G_Debug_allowed := P_Debug_allowed;
G_Session_ID := Next_ID;
Write ('--start ' || to_char (G_Session_ID)
|| '----------------------');
END;

PROCEDURE Write (
P_Text IN VARCHAR2,
P_Session_ID IN NUMBER DEFAULT NULL) IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
IF Debug_allowed THEN
IF G_Session_ID IS NULL THEN
Init;
END IF;
INSERT INTO Logging (ID,
Session_ID, Insert_Date, Text)
VALUES (Next_ID,
NVL (P_Session_ID, G_Session_ID),
Sysdate, P_Text);
COMMIT;
END IF;
END;
END;
/

You start the debug with INIT and end it with DESTROY. Error-Messages are logged through WRITE. For example:

pk_Debug.Write ('Hello World - ' || V_Test);

Parts of your debugging can be deactivated with DISABLE and from this point on nothing will be written into the logging-table till ENABLE is called.

The view V_Logging_desc shows you the logging-data, grouped by the newest session-id.

ID Session Insert-Date Text
============================================
24 21 10.09.-12:38:48 -------stopp 21--
23 21 10.09.-12:38:48 Hello World - 42
22 21 10.09.-12:38:48 --start 21-------


Try it and have fun
Gerd

August 31, 2007

San Francisco Impressions

Here are some impressions from the city, shot in the days after the test-event

From Lombard Street to Coit Tower

17 Miles Drive

Muir Woods

Another proof: Second Life exists in reality and not in virtuality

Stone Art in Sausalito

The Golden Gate

August 24, 2007

Oracle Fusion Middleware 11g Beta Test - Last Day

Today was the last Day of the Beta-Test. After the last testings started the big Feedback-Session in Oracle's Conference Center.

All customers which tested this week and fifty Oracle experts came together, plus dozens through a Web-Conference. In the next 3 hours all products of the Fusion Middleware-Stack got feedback from us. The only tester for Oracle Forms (myself) gave this feedback to Oracle:

First of all: Forms is a really big platform in germany and this Beta 2 program showed us in the last days the first Oracle Forms, which has new functionality in the Forms Builder itself.

After that I described the new features and how important they are for the Forms Community.

In the end I had time to explain, which functionality I personally wish to have in the Forms Builder :

* an object called Web-Service at form-level
* the integration of BI-Beans
* and most important: a new PL/SQL-Editor

That was my statement and now I have to thank Oracle for the invitation to this event, Duncan and his group for the best support that you can have in such a week. It was fantastic to have the chance to work with such profis.

And the last thanks went to Rolf (my boss) who sponsored this trip, Manuela (who let me go) and Andreas, who backup'd me for this week in Krefeld. Many many thanks to you !

This must be the proof, that Duncan's career started in the NBA, before Oracle found him (I'm 6'7"):

PS: If you wonder, why I don't name the new features by name or describe, which functionality they have. Please excuse for that, but I had to sign many Documents at Oracle, which don't allow that.

August 23, 2007

Forms Beta-Test, Day 4

Duncan and I invented a new feature in mind some days ago and today I was able to develop it in Forms 11g and have now a showcase:

Remote Debugging-Start through AQ

The idea is simple: A developer enqueues a payload to a Forms-AQ, where all running forms-applications have to listen on. Then the payload is transfered to a specific forms-runtime and starts a new AQ-Trigger. The user is asked, if he wants to switch into debugging mode. After a Yes the form starts a debug.attach and developer can use his Forms Builder to attach to the clients runtime.

This is a new and interesting remote debugging extension which can be used in Forms 11g.

August 22, 2007

Forms Beta-Test, Day 3

Today Duncan and Phil Kuhn worked hard on some of my forms issues. It's great to see, how they and the team behind them work.

It's the first Oracle Forms Version since seven years, which has new functionality, new objects and new triggers in the Oracle Forms Builder!

All those, who propagated the end of Oracle Forms get invalidated, when the new release is launched.

August 21, 2007

Forms Beta-Test, Day 2

The second day of the Beta-Test started with a big overview of the new Application Server. Four sessions were presented on this tuesday. The rest ot the time was testing Oracle Forms 11g.

At the end of the day Oracle invited us to a nice restaurant near the HQ.

August 20, 2007

Invitation to Oracle Forms beta-testing

Oracle HQ in Redwood Shores invited me to participate at the 2007' Beta-Test for the Fusion product-stack.

Today we started at Oracle HQ with 16 other companies. In addition to us testers Oracle supports us with nearly 50 Oracle Cracks. For example Duncan Mills as Oracle Forms Guru

They created large test-szenarios for our 5 day testings. So we can test all parts of the new versions and look deep into them.

The spirit of the event is great!

August 03, 2007

Set Record-Status to Query after a POST-QUERY

In a block with a POST-QUERY-trigger you often have the problem, that the Record-Status changes to CHANGED, if non-basetable-items were changed through the POST-QUERY.

Setting the recordstatus back to QUERY is a good method to solve this problem. First create a procedure for setting the record-status to QUERY:


PROCEDURE Set_Record_Query_Status IS
BEGIN
Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
STATUS,
QUERY_STATUS);
END;

then use it in your POST-QUERY-triggers:

BEGIN
SELECT someColumns
INTO :myBlock.nonBasetable_Item
FROM myTable
WHERE someFilter;

Set_Record_Query_Status;
END;

After resetting each record to QUERY-Status you don't have problems with the fetched data in this block.

Important: If the POST-QUERY changes Basetable-Items in the record you create record-locks, if the block-locking is Immediate. This problem can be solved:


BEGIN
Set_Block_Property ('myBlock', LOCKING_MODE, Delayed);

SELECT someColumns
INTO :myBlock.nonBasetable_Item
FROM myTable
WHERE someFilter;

Set_Block_Property ('myBlock', LOCKING_MODE, Immediate);

Set_Record_Query_Status;
END;



try it
Gerd

August 01, 2007

Oracle Certified Trainer

Since last Friday I'm an Oracle Certified Trainer. It is the precondition to work for Oracle University.

July 20, 2007

New launch of my Forms Framework project

A place, where you host your open-source-project must be

- easy to use
- easy to administer
- easy to find

and two days ago I found Google Code. That's a gorgeous place to share own projects !

http://code.google.com/p/forms-framework/

Actually I started deploying the main PL/SQL library + Forms Template

have fun with this project and the next releases
Gerd

July 19, 2007

Check Form_Success for each Built-In

Many Built-Ins have the problem, that they don't throw exceptions. (only in the ON-ERROR)

Example: You want to navigate to the block Customer and wrote a typo:


Go_Block ('CUSTOMR');
Do_something_after_Go_Block;

Go_Block can't navigate to the block, because you wrote CUSTOMR. But no exception is thrown inside the PL/SQL-Block. This means, the code didn't stop and the execution of Do_something_after_Go_Block starts. This is a big problem in most cases!

Solution: Create a procedure Check_Builtin

PROCEDURE Check_Builtin IS
BEGIN
IF NOT Form_Success THEN
RAISE Form_Trigger_Failure;
END IF;
END;

Use this procedure after each Built-In:

BEGIN
Go_Block ('CUSTOMR');
Check_Builtin;
Do_something_after_Go_Block;
EXCEPTION
WHEN FORM_TRIGGER_FAILURE THEN
-- do something ...
END;

Also you can create your own Built-In for example Goto_Block instead of Go_Block: This new procedure works internally with the new Check_Builtin

PROCEDURE Goto_Block (P_Block IN VARCHAR2) IS
BEGIN
Go_Block (P_Block);
Check_Builtin;
Do_something_after_Go_Block;
END;

and then :

BEGIN
Goto_Block ('CUSTOMR');
Do_something_after_Go_Block;
EXCEPTION
WHEN FORM_TRIGGER_FAILURE THEN
-- do something ...
END;

Important: When you use this technique you have to write an exception-handling and check the FORM_TRIGGER_FAILURE.

This technique is similiar to Oracle's Check_Package_Failure, but this procedure can only be used, when you work with master-detail-relations.

use Check_Builtin
Gerd