Google Cloud SQL, Hibernate JPA Support

With my last post about Google Cloud SQL(Google App Engine) with Spring Hibernate, many people had encountered the same issue about HIbenrate JPA. If you are developing Hibernate JPA based applications,there is some issues with Hibernate JPA support which you need to be awared.

When you are running the application you may get an error like this:

java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
This is because Hibernate used JPA 2.0 specification. But Google App Engine only support JPA 1.0 specification. I also got the same issue, and therefore I used Spring Hibernate support (instead of Hibernate JPA).

"The App Engine Java SDK includes an implementation of JPA 1.0 for the App Engine datastore"
Google App Engine JPA :

Love to hear from you! feedback(comments) are always welcome

Google Cloud SQL with Struts, Spring and Hibernate

With Google App engine SDK 1.5.5, Google have introduced Google Cloud SQL for GAE (Currently we can't connect any other external application with Google Cloud SQL. This can be only with Google App Engine Apps).

It's faster than connecting with Amazon RDS and other Cloud based Data solutions. No need to worry about load balancing as well. Cloud SQL supports 5 QPS read/write rate, so as long as you don't go over that, you can use cloud SQL. If you are going over this read/write rate limit, datastore might become a much more effective approach to you.If you are storing large blobs data(images, attchments and sound files, it's better storing them in the datastore or blobstore.

When Google App Engine became populer in late 2009 many people asked about Hibernate support. But with their datasore people were unable to develop Hibernate support applications with GAE. But with Google Cloud SQL developers can use Hibernate supported applications as well.

Sample Application with Google Cloud SQL

Three months ago I was able to participate in one of the Google App Engine based task management project.  However, in that project, I had to face some critical issues in searching as Google Datastore did not support many search options including LIKE search. It is known that searching is one of the essential parts of the enterprise applications.

However, Google introduced Cloud SQL last week and they approved my "Google Cloud SQL" request today (they took 5 days to approve it.:D ). Once they approved, I decided to develop a sample application with Cloud SQL. Gogole Cloud SQL database engine is MySql Version 5.1.59 and database size must be no larger than 10GB. Here I have added option to Test LIKE search. If you need more clarification, feel free to contact me.

Test Application

PS: Added Source Code
Sample Project : 
    Backup Link:

New Post : Google Cloud SQL with Spring…

Introduction to OSGi(Java Modular)

OSGi Alliance is the governing body of this stranded and it was started at 1999. their initial goal was create open stranded for network devices. Based on this idea this specification introduced for Java also. Eclipse was first in Java. they introduced OSGi based Eclipse IDE at 2004 June.
OSGi is way to define dynamic module in java. There are main three OSGi container implemented for Java,such as Apache Felix, Eclipse Equinox and Knopflefish.
Why OSGi? Because OSGi provide ability to divided application in to multiple module and those module easy to manage with other dependencies. other than that is very easy to install, update,stop and delete module without stop engine(Ex: Tomcat web application container). We can have multiple version of implementation with effecting to other references.
There are main 3 layers in web based Java framework(Presentation , Business layer and  DAO layer). There we can divide it into three OSGi based module. then we can very easily fixed bug in one laye…

Advanced Java questions -4

A program which will accept three sentences (one sentence per line) and print the words having Initial Caps within the sentences. Below is an example.

Here is an example. If the below three sentences are given to the program as input,

This is a Program
Coding test of Initial Caps
the program Will Test You

Then, the output would look like:


Pattern p = Pattern.compile("^[A-Z]");

Advanced Java questions -3

Where 1999 is the year and 5 is the numeric sequence of the month (corresponding to June). The program should display the day on which June 28, 1999 fell, and in this case the output will be MONDAY.

The output should be displayed in uppercase letters.

Suppose the following INPUT sequence is given to the program:


Then the output should be:



import java.text.DateFormatSymbols; import java.util.Calendar; import java.util.Scanner; public class Solution { /** * @param args */ public static void main(String[] args) { boolean condition = false; do { Scanner scanner = new Scanner(; String value = scanner.nextLine(); condition = value.equalsIgnoreCase("exit"); if(!condition && value.contains("-")){ calculate(value); } System.out.println("Count is: " + condition); } while (!condition); } private static void calculate(String value) { final String[] input = value.split(…

Advanced java questions -2

Write a program that prints the numbers between 258 and 393 (both inclusive) which do not end with 5. The program should print the output so as to have one value per line. The output would therefore follow the below format:

so on
public class Solution2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int start = 258; int end = 393; for (int i = start; i < end; i++) { if(i%10 !=5){ System.out.println(i); } } } }