Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 8:13:28 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

August 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            
Jul   Sep

Get Firefox!

Friday, August 08, 2003

"What's the createRowSet() method on oracle.jbo.ViewObject do?"

As described in Understanding a ViewObject's Default RowSet and RowSetIterator a view object defines a query that produces one or more rowsets of results. For ease of use, the view object aggregates an oracle.jbo.RowSet that acts as its "built-in" default rowset, since for 90% of the typical use cases, you only need to work with one rowset of results at a time. RowSets that are not the "built-in" one for a view object are known informally as "secondary rowsets". They are useful if you have a view object that has bind variables in it, and if you need to iterate through the results of more than one set of result rows, based on providing different values for those bind variables. Imagine a tree control that's showing sales people, and indented under each salesperson, the open deals they have in the pipeline. The query that produces data for the pending deals for a given employee might have a bind variable for the employee's id number. Using secondary rowsets, you could browse and update the deals of five separate employees at once.


5:41:07 PM    



"Is there a way to create transient rows that are never persisted?"

Sure. When you define a view object, you can create it with all transient attribute and no related entity objects. When you create a new row in the default rowset for such a view object, it's just a "bag" of transient attributes that you can use like a transient row. To create such a view object, you click the (New...) button on the "Attributes" page of the View Object wizard and define your attribute names and types. Then, you just don't enter in a query for that view object.


5:31:59 PM    


Next week we'll be conducting parallel expert testing sessions on JDeveloper 9.0.5 Preview at the Oracle campuses in Redwood Shores and in Reading, UK. We sit expert users in front of our upcoming major new version and watch what they do as they attack solving various development problems with a bunch of our new features. You definitely learn a lot by watching someone use your product... Brian Duff wrote a nice article this week on Why We Watch Users, explaining a poignant experience of trying to teach his "mum" to use Windows XP.
5:24:47 PM    


"How can I install the BC4J Toy Store demo application on Tomcat 4.1.24?"

In short, without a little additional help, you can't. But I'm here to help...

The original BC4J Toy Store Demo contains references to two JDBC datasources named jdbc/toystoreDS and jdbc/toystore_statemgmtDS in the configuration parameters for the main toystore.model.services.ToyStoreService application module. After digging into some user complaints about my demo's not working under Tomcat 4.1.24, I realized that while some J2EE containers support looking up JNDI resources using unqualified names like those, the more portable solution is to define the datasources as application-scoped resources in your web.xml file, and then lookup the names in the scope of your application's resources using names like java:comp/env/jdbc/toystoreDS and java:comp/env/jdbc/toystore_statmgmtDS instead.

I made the necessary small modifications and updated the ./doc/readme.html file that accompanies the demo to contain a new Appendix that describes the additional required steps to setup the Tomcat-specific datasource configuration information. All the links and info you need are in this short article on the subject: Installing the BC4J Toy Store on Apache Tomcat 4.1.24


2:17:15 PM    


"How do you debug a web application running under Tomcat using JDeveloper?"

I like to debug using our Oracle JVM because our debugging and profiling features are faster and richer when using this VM instead of hotspot. Of course we support using and debugging with hotspot as well, but since rarely if ever does a problem that I'm debugging turn out to be a Java VM-related issue, I'll take the faster/richer debugging experience any day. At the moment, using our "Ferrari" Oracle JVM is a Windows-only option, but for JDeveloper 9.0.5 we've ported this instrumented VM to other platforms as well. Our online help goes through the steps of setting up debugging for both Oracle JVM and Hotspot, but if you want the fastest debugging experience and you're on Windows, then you can use a little BAT file like this one to startup Tomcat in a debug-on-demand mode:

@echo off
setlocal
REM Use the Oracle JVM that's in my JDeveloper 9.0.3.2 install dir
set JAVA_HOME=C:\jdev9i\9032\jdk
set JAVA_OPTS=-XXdebugondemand
pushd C:\apache\jakarta-tomcat-4.1.24\bin
call startup
popd
endlocal

The -XXdebugondemand flag to the VM will startup the Oracle JVM in a mode where you can connect the JDeveloper debugger to it and detach the debugger from it whenever you want. To setup your JDeveloper project for remote debugging, edit the project properties and visit the "Remote" sub-category of the "Debugging" tab in that dialog. Check the "Remote Debugging" box.

Then, to run the debugger and attach to the running Tomcat servlet container, just click on the "Bug" toolbar icon, and indicate the name of the machine and port number where your Tomcat server is running. Taking the defaults will attach to the server-side VM debugger on port 4000. Leaving the "Host:" field blank in the "Debugger - Attach..." dialog will default to the local machine.

When the JDeveloper debugger connects to the Tomcat servlet container, you'll see messages like the following in the JDeveloper log window:

Debugger attempting to connect to remote process at LocalHost 4000.
Debugger connected to remote process at LocalHost 4000.
Debuggee process virtual machine is OJVM Client VM.
Debuggee process is application server Tomcat.
To test JSPs or servlets, you must start a browser.

Then just browse a page that will cause your problem to occur to hit whatever breakpoints you have setup.


10:49:15 AM    


© Copyright 2008 Steve Muench.