Dive into BC4J and ADF

Send me a mail
 Dive into BC4J and ADF    Click to see the XML version of this web page.   (Updated: 6/3/2006; 11:49:45 AM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper 10g

Search blog with Google:
 

Search BC4J JavaDoc:
 

October 2003
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Sep   Nov

Get Firefox!

Tuesday, October 07, 2003

Have you ever written a hairy piece of PL/SQL code and then from somewhere deep in the bowels of your many routines, you find that under some situations you are getting an ORA-6502: Value Error, but you can't figure out why? This error occurs, among other reasons, when you try to assign a value to a variable that it's too small to hold. For example, consider a very simple PLSQL procedure like:

procedure example( v varchar2) is
  lv_temp VARCHAR2(7);
begin
  lv_temp := v||'X';
  dbms_output.put_line(lv_temp);
end;

If you happen to invoke this routine, passing a value that is already seven characters long or more, it's going to raise a VALUE_ERROR exception when the first line of the procedure body tries to concatenate an 'X', making it 8 long.

The JDeveloper debugger works for debugging PL/SQL code, but a little-known feature is that we also support exception breakpoints for PL/SQL. So, if you happen to know that you want to stop whenver an ORA-6502 error occurs, just create a (specially-named!) exception breakpoint on the exception "class" named $Oracle.EXCEPTION_ORA_6502

You can substitute the 6502 part in the name above with another ORA error code, too. When you debug your routine, it will stop the debugger in its tracks whever this VALUE_ERROR (ORA-6502) occurs, and you can figure out from the stack and the data window who is the culprit.


6:45:25 PM    



Somehow my whitepaper entitled Simplifying J2EE Development with BC4J which normally lives at this URL:

http://otn.oracle.com/products/jdev/htdocs/j2ee_bc4j.html

has gone missing off OTN. While the OTN content management mavens figure out what happened to my file, in the meantime (since already four people have asked me about it since yesterday), I've reposted it for download here on my personal website: jdev_wp_bc4j.zip. The file contains one HTML file and an images directory. Make sure to extract it with directory names preserved.


4:42:45 PM    


I spend a reasonable amount of time being asked to have a look at customer applications and make comments about how they were implemented. After doing this many times for web applications, I found it was worthwhile spending two or three months of my time (off and on) writing and documenting the BC4J Toy Store Demo, that uses BC4J and Struts to illustrate a best practices Web Application with JDeveloper 9i, release 9.0.3 and 9.0.4.

Some time ago, one of our developers on the JClient team took a similar amount of time and built a demo that illustrates virtually all of the different kinds of JClient bindings for Swing-based UI's that we support. In case you missed it, I'd recommend that you download the JClientBindingDemo.zip and read the JClient Component Bindings Demo whitepaper on OTN that explains how to setup and run the demo.

Unfortunately, I see plenty of examples of customer's JClient applications written in a way that tells me people did not spend the time to learn about JClient and how to use it properly by studying this comprehensive demo. The BC4J framework takes care of many details automatically that some customers seem to insist on writing code to duplicate (often causing unnecessary network roundtrips when deployed in a 3-tier configuration). One great example is view links. I've just spent hours looking through the code of a customer's JClient application only to realize that in many places they were hand-coding the synchronization between master and detail view objects by manually retrieving the values of the primary key fields in the current row from the master, and individually setting foreign-key bind variables on the children view objects to query up the related data. View links to this all for you automatically with more efficiency, since often master and related detail data can be retrieved over the network in a single round trip.

Definitely worth a look. It even shows off cool features supported out of the box like Tree Control data bindings, support for images, video, and sound, as well as many of the common kinds of things that rich-client data entry applications need to do most frequently.


3:29:23 PM    


© Copyright 2006 Steve Muench.