JavaOne 2008 Day Two

Posted by Jeroen van Erp mid-morning: May 8, 2008

Today was the second day of the JavaOne 2008. Besides doing a lot of chatting in the JavaOne pavillion, and visiting all the cool parties this night, we also went to a number of sessions. Also today the NLJug had the James Gosling meeting we won for being the biggest JUG out here. After a long day of work, we finally had time to relax at the Adobe party and at the SDN party.

Todays topics included:

  • Closures
  • JavaFx, Groovy and Google Android
  • Swing GUI testing
  • Scripting

(more...)

Oracle and ORA-08177

Posted by Peter Veentjer around lunchtime: November 28, 2007

When using Oracle, or other MVCC (Multi Version Concurrency Control) databases like Postgresql or MySql in combination with InnoDb, a transaction with the SERIALIZABLE isolation level doesn't always block (a pessimistic approach) when it conflicts with another transaction. Instead a more optimistic approach is used. This approach however can lead to an abort of the transaction with the feared: "ORA-08177: can't serialize access for this transaction", which in essence is just an optimistic locking failure. (more...)

EJAPP Top 10 countdown: #1 - Incorrect database usage

Posted by Vincent Partington in the late afternoon: April 29, 2007

I'll keep you in suspense no longer. ;-) It's time for numero uno of the EJAPP Top 10 countdown!

Somewhat unexpectedly for an Enterprise Java Application Performance Problems Top 10, the #1 issue is the incorrect usage of databases.

(more...)

Using property files in OC4J10.1.3

Posted by Lonneke Dikmans in the late evening: October 1, 2006

Often JEE applications contain property files with environment specific information. Because deployment should be automated, you need some way of dealing with these property files. Basically you have three options:

  1. Put a default property file in the ear and edit it after deploying it to the server. This means you have to do some scripting with Perl or some other language.
  2. Choose the property file to put in the ear before you deploy. If you choose this option, you need to know the correct property values in advance. Further more, you need to tell maven or ant which property file to deploy by setting some sort of environment flag
  3. Store the property file on the system classpath instead of in the ear. This has the disadvantage that you need to restart the server every time you want to change something in the file.

Usually property files are application specific, so I prefer either of the first two options. The other day, however, I got a call from someone who needed to store the property file on the servers' classpath.
Of course(!?) every application server is different. In IBM Websphere you put property files in the [WAS_HOME]/appserver/properties directory and configure the server, so it knows where to find the property file.
(NB: for those of you who have been looking for this feature: it is hidden under Application Servers > [server] > Process Definition > Java Virtual Machine - Custom Properties) The Oracle application server doesn't have a folder like that, nor does it have any options to specify property file locations. So where do you put property files if you want to put them on the system classpath? The Oracle container (OC4J) has two possible candidates for this property file:

  • the applib directory
  • shared-lib directory.

I decided to do a little test: I created a test application that displays the values in a property file. I used the standalone OC4J(10.1.3) for this test, but it works the same way in the Oracle Application Server 10g. First I tried the applib directory. I deployed the application to the OC4J, stopped the server and copied the property file into the [ORACLE_HOME]/j2ee/home/applib directory. Then I restarted OC4J. The web application displayed the values in the property files correctly. Next, I removed the property file from the applib directory and put it in the [ORACLE_HOME]/j2ee/home/shared-lib directory. I restarted the server and tried again. This time, the property file was not found.
This made me wonder about the differences between the two. The applib directory is used by all applications. Libraries and other files that are put in this directory are loaded before libraries and files in the WEB-INF/lib directory of your ear file. In the Oracle® Containers for J2EE Developer’s Guide 10g Release 2 (10.1.3) , shared libraries are explained in great detail. Basically you use these if you have an application that needs to use a different library than the standard library that is packaged with OC4J. An example can be the XML Parser you want to use, or a different version of the Oracle JDBC driver. Another reason to use shared libraries is to share proprietary classes across specific applications, rather than across all applications. To accomplish this, you obviously need to configure your application to work with the shared libraries. The developers guide describes the steps to do this. So if I really wanted to try if the shared-lib folder works for the property file, I would have to configure the shared libraries and my application. I decided not to bother...I am not sure what happens if the application is clustered, but since this was not a requirement when I got the question, the applib directory looks like the simplest solutions that could work in this particular case.

Article “Using Oracle TopLink with the Spring Framework” published on OTN

Posted by Lonneke Dikmans at around evening time: September 26, 2006

Today the Oracle Technology Network published my article Using Oracle TopLink with the Spring Framework. In this article I explain step by step how to build a sample application using Spring 1.2.8 and Oracle TopLink with Oracle JDeveloper 10g.

JDeveloper has built in support for TopLink, but you can build the sample application with Eclipse as well. Download the sources and follow the steps in the article. Instead of editing the TopLink sessions in JDeveloper, edit the xml files in the Eclipse editor or the TopLink workbench.