Tuesday, September 26, 2006

Nischey Ker Apni JEET Keron.

[Saint Soldier]
Grant me this boon
O God, from Thy Greatness
May I never refrain
From righteous acts;
May I fight without fear
All foes in life's battle,
With confident courage
Claiming the VICTORY!
May Thy Glory be
Grained in my mind,
And my highest ambition be
Singing Thy praises;
When this mortal life
Reaches its limits,
May I die fighting
With limitless courage!

Monday, September 25, 2006

Sandy rocki'n Niagara!


What is character?
Is it in your blood?
Or can it be learned?
Is it timeless?
Is it obvious?
Or is it impossible to define?
Will you recognize it when you see it?
Not if you have to ask!

Friday, July 21, 2006

Problem in consuming a Java Web Service in Coldfusion

Thanks Guys - Kinda thought of giving you an update on this problem. Well its definitely a bug or rather a compatibility issue with AR System and AXIS version we used to inoke this web service on the former.

But good thing is that for us we had a work around of using a Servlet/JAVA API to create entry in Remedy BUT we found this could be possible even through CFHTTP. I had tried using CFHTTP but missed a header name.. here's the code..I hope this will help..

Hi All – We have a web service running on ARSystem ( Remedy) and all we would like to do is



-Invoke this web service from our Coldfusion page

-Send some parameters in a method call for ‘Remedy WS’

-This Webservice returns a simple String object.


The Exception I am receiving is as follows and I am not sure if there is any SOAP Header

which we are missing or a Complex types creating issues in Java and Coldfusion problem.

Could not perform web service invocation "opCreate".

Thursday, June 29, 2006

Performance Improvement for CMP

Though not very popular choice for persistence nowadays, CMP still too often is only readily available persistence framework in Enterprise environment. While not as sexy as hibernate or SQL Maps, CMP 2.X implementation in leading application servers such as BEA Weblogic offers quite good solution for ORM problems. Beside there is a lots of developers familiar with EJB and mature support from different tools from xdoclet to Eclipse wtp/jst.
Let's take a look at what can be done to improve performance of CMP in Weblogic by enabling more aggressive than default caching strategies.
Everybody knows that EJB Container maintains cache or pool of Entity Beans, usually configurable in deployment descriptor. Amazingly lots of developers don't realize that it doesn't mean that once Container loaded particular bean instance from database it won't go to database again while bean instance is kept in pool. Quite contrary, by default Container calls ejbLoad() to synchronize instance's state from the database at the beginning of every transaction. Basically on every operation with CMP bean, even if bean was loaded seconds ago in previous transaction Container executes SQL select to refresh it. Only while you operating with CMP instance(s) in one transaction Container caches them. This is so called 'Commit Options A/B/C' as described in EJB 2.0 specification (10.5.9).
Obviously reloading state from database in every transaction could have some performance impact. Easy to understand why this is default behavior - this is safest way if database shared between multiple processes and each one of them could change state of persisted object in database while it's cached in EJB pool. In this case we're facing possibility of lost updates - other process updates record in database and then Container overwrites it with potentially stale data from cache. But first of all refreshing data in the beginning of transaction doesn't guarantee against lost updates, it's just reduces possibility of it. This is a well know problem in database world and there are two approaches to deal with it. First approach is so called 'pessimistic concurrency locking', when records in database locked for other updaters for duration of transaction ('select for update'). This is almost never used because of significant overhead and performance impact. Second approach is called 'optimistic concurrency locking', in this case there is no actual locks held in database but process which execute update has some mechanism to detect that record been updated by other process between his read and update. Preferred way to implement this is with 'version' column on the database table (in SQL update increment value for that column, include previous value in 'where' clause and then detect if no rows are updated).
Weblogic has built in support for optimistic concurrency in CMP beans via verify-columns element in weblogic-cmp-rdbms-jar.xml deployment descriptor. It is a good practice to have 'version' column in all (updatable) tables in your database and configure CMPs to use it by enabling optimistic concurrency in concurrency-strategy element in weblogic-ejb-jar.xml
Optimistic concurrency alone doesn't give you any performance improvement, but it's necessary step to enable cache-between-transactions functionality which is not available without enabling optimistic concurrency (for the reasons discussed above). Setting cache-between-transactions to 'true' will result in Container skipping calls to ejbLoad() if bean instance is already available in the EJB cache. For certain types of applications where the same objects accessed more than once from different transactions over short period of time this can lead to significant performance improvements (in our tests up to 30% for our application).
Naturally your application must be ready to deal with OptimisticConcurrencyException when concurrency violation is detected by container. When OptimisticConcurrencyException (subtype of RuntimeException) is thrown Container discards EJB instance from cache. In a cluster, when a bean with Optimistic concurrency is updated, notifications are broadcast to other cluster members to prevent optimistic conflicts. Note that if you have delay-updates-until-end-of-tx set to 'true' (default) your code won't see optimistic exception until transaction commit.
Word of caution. While available for quite a long time, cache-between-transactions functionality never worked stable in Weblogic 7, but it seems to be fixed in version 8.1.

Tapestry is now Apache Tapestry

After a succesful stint as part of the Apache Jakarta project, the Tapestry project has finally "graduated" to a top level Apache project!! Tapestry is one of the first successful component-based web frameworks, and is quite popular in some places.