You can now download the early adaptor release of Project Raptor. Project Raptor is a graphical tool for generating and browsing database objects. This means that, depending on your requirements, it might be a good alternative to TOAD. A production release is planned for early 2006.
Weblog
Project Raptor available for download
WYSIWYG in BPEL
One of the great advantages of BPEL is the graphical design environment. Easy to build a process and perfect to illustrate the working of the process, especially to end-users. But, there’s a catch! Not all changes in the XML-source code are reflected on the graphical end. There are a lot of actions you can take in the XML (all the bpelx: actions) that aren’t shown on the graphical side. Even worse: when you update them, they won’t always show up in the JAR file that’s generated. So keep in mind: if you make changes to your code in XML format, especially when you change bpelx: commands, DELETE your .jar file, so it’s rebuilt. Otherwise you’ll keep looking for that one error that’s no longer there!
Turning a recursive hierarchy into a dimension Part 1: Fixed depth
One of the more challenging issues when modelling dimensions are variable depth recursive structures. The most common example is the manager-employee example. These employees both exist as a record in an employee table and are linked to one another by a recursive ID (manager_ID) which reflects to the tables sequence number (ID):
Table: Employees
| ID | Name | Function | Manager_ID |
| 1 | Roelant | BI Consultant | 3 |
| 2 | Ilona | BI Consultant | 3 |
| 3 | Bram | Manager | NULL |
The organisational structure following this table can be variable in depth. For instance, its easy to to add another manager to the table and thus making this dimension three layers deep.
Generally, there are two ways to approach this: wrapping the data to a fixed level depth or creating a bridge table for more flexibility. Today I’ll focus on the fixed depth solution.
For this solution you decide how many levels you want to show in your dimension (preferably the most detailed level) and read out the recursive table into a cursor, in order to fill out any branches who do not reach this level of depth.
But first, try this query to show how the hierarchy is build up from the data as it is:
SELECT LPAD(' ',2*(LEVEL-1)) || Name AS Hierarchy
FROM Employees
START WITH Manager_ID IS NULL -- Highest level in hierarchy
CONNECT BY PRIOR ID = MANAGER_ID -- Determine recursive pattern
This query shows the possible ‘gaps’ in the hierarchy, because not everyone fits easily in every level. For instance: a delivery organisation has more managing layers than sales in most cases, but they both are part of the organisational structure as a whole.
In order to fill out the branches where the lowest level in that particular branche is higher than the lowest possible level (max level) you need a cursor to prepare your data for the dimension. Use this cursor to select the level and the employee name from your source table and cycle through the whole structure to fill out the blanks.
You will need to define a variable for each attribute (level) in your dimension and use the cursor to fill these variables and insert them into a temporary table from which you can process your organisation dimension (for instance).
There are many solutions for this and they all depend nt on specific situations. In this example you could use logic like this:
If level = 1 (highest ranking manager) and you have defined your structure to be 4 layers deep. You can set the following variables: top_manager = name , sub_manager = name, team_lead = name, employee = name.
The next record in the cursor will be level = 2 (sub_manager). You don’t have to update the top_manager variable now because it’s already known at this point. Instead your record will be name_old, name, name, name. If you use the employee ID’s the end result will be something like this:
Top Sub Team Emp
1 1 1 1 (entry of top manager)
1 2 2 2 (entry of sub manager)
1 2 3 3 (entry of team lead)
1 2 3 4 (entry of employee one)
1 2 3 5 (enty of employee two)
1 2 6 6 (entry of team lead two )
1 2 6 7 (entry of employee three) and so forth.
By inserting these records in your dimension you can add your facts (for instance earnings, or costs) to everyone at the lowest level (employee) and you will avoid facing the problem of combining aggregated facts to different levels in your dimension. For instance if you want to see the total costs which the top manager if facing, just make a count using the TOP attribute. You can do this because everyone has the same top managers (1 in this example).
Have fun!
Just so you know: CONNECT BY cannot be used in joins.
XML queries and cursor expressions
Eddie Awad has an interesting post on generating xml using cursor expressions: Producing XML from SQL using cursor expressions. Be sure to also read Aino’s comment, where he shows how you can achieve the same thing but using the xmlelement and xmlagg functions.
Oracle Metalink, New and learns us a lesson
As mentioned by several other blogs the interface of metalink has substanially changed. I used the entire day browsing through most of the sections and must say I like it. The search function is much easier to use and the speed seems faster then before. There are a few glitches here and there where sorting isn’t done properly but overall I am happy.
That is till 16:30 local time, 8:30 / 9:30 for most of the US, Metalink ground to a halt. Oracle metalink became very slow and eventually ended with this very pretty error.
Error ERR-1029 Unable to store session info. session=2394804854123761172 item=67518425616379171 ORA-01654: unable to extend index FLOWS_010600.WWV_FLOW_DATA_IDX2 by 1024 in tablespace HTMLDB
It took about a hour to get things rolling again. Above error shows that introductions of a new system should always be closly monitored. There are better ways for winning the approval of your users then a system where nobody van login.
OWB – Map terminated due to cursor fetch error
Did you ever get the error: “RTV-20007: Map terminated due to cursor fetch error” followed by error: “ORA-12702: invalid NLS parameter string used in SQL function” after running a mapping create with Oracle Warehouse Builder and this occured after validating the mapping successfully?
Well if you did, here is some help to find the cause of the errors.
Both the errors are related to the same thing. You probably try to fetch data that should be converted to somekind of date format using a TO_DATE conversion in an expression attribute. The cause of the error is inconsistent data that you are trying to convert, so that not all data can be converted to the format you defined in the TO_DATE function.
You can solve this issue by first checking the data. Do a select distinct on particular field(s).
- check if the string to be converted has the right lenght.
- check if the month and day strings are valid.
You could write an alternative date conversion function like below, and use it in the particular expression attribute.
Sample code:
CREATE OR REPLACE FUNCTION ALT_TO_DATE( p_string VARCHAR2) RETURN DATE AS -- When the conversion is not valid return Null. BEGIN TO_DATE(p_string); EXCEPTION WHEN OTHERS THEN NULL; END;
JSF adopts Ruby On Rails concept of a Flash object
Have you ever used a redirect in your Struts application between a store action and a diplay action to overcome a double-submit? You may have noticed then that your request variables, set in your store action, are lost in the request object available in the display action. To overcome this problem you can use session variables instead, however this will force you to unset the variables after you have used them otherwise your session will become a mess.
However there’s is hope..
The guy, who invented Ruby On Rails, thought about this issue and came with a gentle solution. In RoR you can use a flash object that can be used to store variables that you need in the next request. This is very handy to set progress messages in the store action and display them after a redirect to the user.
But, I’m stuck in Java… I hear you think..
But, there is also hope for you.. In a posting at Sun’s java forum, you can read that Ed Burns has made a JSF extension that implements the concept of a flash scope in JSF.
Stop doing keynotes, start doing Radraces
I think it’s clear after Javapolis that IDE venders should stop using the keynotes to plug their products. It’s shameless, and they know it. They admit it. So, just stop it. Instead, just enter the Radrace, like Oracle. Show us how good your tools are. And please, please, publish all the requirements, and all the generated code, with explanation how you achieved your results. I want to see what made the difference. This will really prove how good your tool is.
JDeveloper big winner at Javapolis RAD race
The result are in, there are actually three winning teams: AXI, Oracle and LogicaCMG. And the stunning thing is that all three teams were using JDeveloper. AXI in combination with their own framework. Oracle was using JDeveloper 10.1.3 with Business Components and ADF Faces (JSF) and LogicaCMG was using Oracle’s JHeadstart. Congratulations to Oracle for building a very productive development environment.
Javapolis: day 3
This morning started with two keynote presentations, the first one by Sun and the second one by Bea. Nothing particulairly interesting or spectaculair was said. Both companies talked about how they are making Java development simpler (although Suns demo makes you think otherwise). Both companies used the stage to promote their products and websites.
It’s kind of disappointing that none of the Java IDE vendors have yet announced anything which competes with Microsofts Visual Studio Team Edition. For bigger Java projects you currently configure your own software factory based on multiple tools and frameworks. Most of these tools are opensource and free, such as cvs, subversion, cruisecontrol, junit, pmd, findbugz, bugzilla, wiki, statcvs. Sometimes it’s better to use a commercial offering such as jira or anthill.
The problem is that configuring these tools takes time, you need to install and configure a development server running a lot of tools. And if you use ant, you also need to modify your ant build file to generate all the required artifacts. A better option is to use maven which automatically generates most of these artifacts for you.
Tighter integration between these artifacts and tools would be very useful. So it’s time for Java IDE vendors to learn from the community that there is a need for these tools and to supply ready to use solutions.
JMX
The next session was about JMX. The speaker presented several ways to publish management information through MBeans. Among these were ofcourse dependency injection and aspects. He then finished by discussing the changes in the following versions of JMX, such as a web service API. I think, for people new to JMX, a good use case was missing in the presentation. Just show me some real examples of how applications are using MBeans. What makes sense and what doesn’t?
EJB 3.0
Linda DeMichiel and Mike Keith did a presentation on EJB 3. Main topic here, simplicity. I went to the EJB 3.0 persistence presenation by Mike on monday and after seeing todays presenation on the other stuff in EJB 3, i’m convinced that EJB 3 can finally become the standard for writing server side business logic and data components. It seems like the need for alternative technologies has become a lot less with EJB 3. Most people currently like to use orm frameworks like Hibernate and Toplink. It looks like ejb 3 ORM is close enough to these frameworks that most people will be satisfied by it.
One point repeated during the EJB presenation was that the JEE 5 Reference Implementation is now production grade software, meaning that it’s not just for testing but you can actually use the RI in a production environment. This probably means that more proprietary extensions to the standard will appear. How else are companies going to sell their application servers, if the reference implementation is good enough for production?
SDO
Next session i attended was the session on Service Data Objects. SDO recently got a lot of attention when Service Component Architecture(SCA) was announced. For info on an opensource implementation of SCA and SDO have a look at Tuscany.
SDO’s goal is to simplify and unify access to data. One way to access your data regardsless of where it is. Your data can be in a database, but it can also be a webservice, or something else. A nice feature of SDO: you can access data using xpath expressions. Another one: SDO keeps track of the changes you make to your data. This means that you only send the changes and their old values (for optimistic locking) back to your datasource.
SDO certainly looks useful, i could have used it on my current project. We currently query data from a database using Oracle’s Business components, serialize it to XML (also using BC) and send it to a swing client on a laptop using a web service. There the user can change the data, and send it back using a webservice. On the server we update the database based on the changes made by the user, again using business components. This seems like a scenario where SDO would make sense.
A future version of SDO will contain support for other languages, such as php and .net. It will for example contain interoperability with ADO.net datasets.
SOA
John Crupi presented Pragmatic SOA. After introducing Service Oriented Architecture he had some usefull tips, or big rules, for implementing soa’s. The presentation was finished with a demo of the BPEL designer in Sun’s Java Studio Enterprise. Very similar to Oracle’s BPEL designer in JDeveloper (and i believe the jboss guys also have something similar).
ESB
Dave Chapell more or less said the same things about SAO in his presenation: How the ESB delivers on the value of SOA, with one difference. For high availability, or Continuous Availability Architecture (CAA) you need messaging, so you need an Enterprise Service Bus.
Shale
The day ended with a presenation on Shale, also know as Struts version 2, although its goal is different from Struts. Struts is an MVC framework, but JSF already contains an MVC framework, so that’s not needed.
So what that Shale contain?
It enables you to apply the Command and composite patterns to JSF. You create command classes, which you can hook up to JSF backing beans using a configuration file.
Something else Shale provides is client side validation using jakarta commons validator. It contains tags which will create javascript to do browser validations.
Another thing Shale contains is Shale Clay which is similar to Tapestry Views and Facelets. It enables you to create html page design, and add JSF components into these html pages. This way a web designer can design html pages, and you can hook JSF components into these pages. I’m not sure this is a good idea though. I think graphic designers should stick to photoshop or illustrator. Page layout doesn’t belong in html, it belongs in css files, and i think web developers are better equiped to translate photoshop design into html and css implementations than designers.
Anything else? Yes, Shale webflow. If you want to know what that is, have a look at Spring webflow, as shale webflow is a direct copy from springs webflow.
And finally, shale contains support for AJAX like remote method calls.
