A new decade for Enterprise Java Applications

We are coming up on the 10th anniversary of the EJB 1.1 final release. When you take a look at the J2EE specification and the Enterprise Java Application programming models and frameworks that are out there now you begin to appreciate what an important step the EJB specification was. Not so much for what you can do with it today, but how it introduced a paradigm shift.

A more recent paradigm shift is cloud computing which effectively puts the application container, in a container. One to watch is CloudFoundry which provides a pay-as-you-go platform using the SpringSource application server. This is a Spring base java application server which is built on Apache Tomcat. The CloudFoundry makes this platform available using Amazon Web Service infrastructure. Although still in beta, it is available now.

Computer Software articles to use on your website

Often, when getting a web site or online service started the ‘shop front’ can look bare until you build up content. Producing your own content can take time. One option is to use free articles from other sources. The Computer Software section at Article Alley has hundreds of software product and software development articles that are free to use. The software articles cover a wide range of sub topics such as security, integration, gaming, office productivity, business management and lots more. Article Alley does have a broader article directory with articles on almost any topic. Their content is free to use if a working hyperlink is retained to the source page on Article Alley and the author has selected their articles to be free to republish.

TrImport – Trim your insert statements

Did you ever want to copy data from database to another and want to exclude certain columns? With the basic export utility in SQL Developer one can specify a selection criteria (effectively a where clause) to export certain rows. It will produce an SQL script with insert statements. However, virtual, or calculated, columns are also included, even though their data can be derived. This is a problem only when attempting to run the script against the target database, it will not allow you to perform an insert on a virtual column. It is my understanding that this is to be addressed in a later Oracle Database 11g release. Until then, what are you to do?

Well, you could use Oracle Data Pump to export only the specific columns. However, in my case, I had the export SQL scripts to start with, provided my someone else, and not the original DB.

I put together a very simple Java Swing application (called TrImport) which allows you to remove columns, and their corresponding values, from an insert statement in an SQL script.

With TrImport now you can easily change the following SQL statement

insert into TABLE_A set (ROW_ID, NAME, DESC, NAME_VC) values (456, ‘Record Two’, ‘This is a record’, ‘record two’);

to this

insert into TABLE_A set (ROW_ID, NAME, DESC) values (456, ‘Record Two’, ‘This is a record’);

with ease. Obviously the benefit is not that this can be done with just one insert statement, but all of the insert statements in a file.

The steps are really simple:
1. Open the file with you SQL script. This can be a mixed script with inserts, updates, comments, just about anything.
2. Open the columns window to see the tables and columns that TrImport has identified in any insert statements it has found.
3. Tick the columns you want to exclude and press OK.
4. Save the file to a new location.

TrImport is not just for virtual columns either, it can also be used in a situation where the table in the destination database has fewer columns.

To get TrImport and run it simply download the trimport-0.1.jar and from the command line execute ‘java -jar trimport-0.1.jar’. If you wanted to, you could setup a short cut. TrImport is provided without any support. It has only been tested with a small set of SQL scripts and only with one function, that is to_timestamp.

Broadband in India

Normally I would not provide a link to a site without a privacy policy. However, for India Broadband Forum I will make an exception with a warning: do not post, just browse for information to see what others are saying about broadband providers in India. The reason I’m doing this is to highlight the huge differences in services provided in different regions. This is important particularly if you are relying on staff in India to work from home at times that overlap with Eastern or Pacific timezones.

You could use the World Speed Test to compare download and upload speeds between regions, cities and service providers in India. Mumbai (10.08 Mbps max) is better off than Madra (9.09 Mbps max), which in turn is better off than Bangalore (7.21 Mbps max). This, however, only gives you part of the picture. The forum, with it’s groups and blogs can give you better insight into user’s experiences with reliability, cost and support. Fast internet access removes one of the barriers to effective distributed teams.

Coherence failed to load the factory

Recently I’ve been working on a set of applications which are deployed in their own, separate OC4J instances in a cluster. Many of these applications share data and Coherence is used to provide synchronised data caching between the OC4J instances.
Normally this is straight forward enough, except that when I went to set up another environment I started getting failures at startup.
The logs would show messages like…

getConfigurableCacheFactory “Failed to load the factory”

and

Caused by: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
at com.tangosol.util.Base.ensureRuntimeException(Base.java:286)
at com.tangosol.net.CacheFactory.getConfigurableCacheFactory(CacheFactory.java:607)
at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:686)
at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:664)

Coherence generally has nice, helpful, error messages which point you in the right direction to solve the problem. This time however, all we got is a ‘Failed to load the factory’ message which, while accurate, does not give an indication about how to fix things.
After some verification in my local development environment I determined that the above message occurs if the coherence cache config file can not be found in the location specified, or if the config file XML is not well formed. In other words, the factory can not be loaded if the cache config file can not be found or parsed.