Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Archive for the ‘Programming / tutorials’ Category

Login issues at skill-guru

January 13th, 2012 Vinay No comments

Updated Jan 14: We have resolved the login issues users were experiencing. Some users were not able to see the tests they had purchased. All these issues have been resolved. If you are still experiencing any problems, please drop a mail at support@skill-guru.com

Some of the users are still facing issues while logging into the site. We are aware of situation and trying the fix it

We appreciate your patience

Categories: Programming / tutorials Tags:

New practice test on Spring Certification

July 24th, 2011 Vinay No comments

After huge success of last two Spring mock tests from ikoko, Jacek has added another test for our readers .

Spring 3.x certification mock test

Questions very similar to originals with almost the same difficulty level. Majority questions are from most important sections at exam: container, testing, AOP, transactions. Only few from other sections like MVC, REST, JMX, JMS.

This is a 30 question practice test. 5 questions are free for you to try.

It is very reasonably priced at $1.99.

If you buy all there tests, you would save on paypal fees.

I am sure you would like the test. Jacek is looking for feedback and inputs to make the test better.

Categories: Programming / tutorials Tags:

Adding google +1 button to your website

July 20th, 2011 Vinay No comments

Google has launched an answer to facebook like with Google +. I have not yet started seeing the effects but definitely you I am sure over a period of time, it will effect my search results.

Here are way to add google + on your site.

1. Go to your webmaster console.  i am sure if you would like to add google+ on your site you would have a  account with google webmaster.

2. Go to +1 Metrics –> search impact on your left and click on it.

3. You would find see a heading Add +1 button on right. Click on that and it will lead you to a page which code generated like

<!– Place this tag in your head or just before your close body tag –>
<script type=”text/javascript” src=”https://apis.google.com/js/plusone.js”></script>

<!– Place this tag where you want the +1 button to render –>
<g:plusone></g:plusone>

4. Add that code on your site. If for some reasons this does not work as it dies work with jsp and jsf sites, add this
<!– Place this tag in your head or just before your close body tag –>
<script type=”text/javascript” src=”https://apis.google.com/js/plusone.js”></script>
<div data-size=”standard” data-count=”true” align=”left”></div>

Preview the page and + 1 button has been added to your  site

Categories: Programming / tutorials Tags:

Disadvantages of Hibernate ?

June 15th, 2011 Vinay 2 comments

When googling disadvantages of hibernate, you would find lots of discussions and arguments as to what works and what not in hibernate. This is year 2011 and Hibernate 3.2 has been released . An an ORM framework it has matured a lot . I will sum down my experience of working with hibernate so far

1. If it is a small project with few tables , I think there is no need for a full fledge ORM framework like hibernate. You can very well using Spring with JDBC and keep complexity to minimum.

But this is a classic mistake made by teams initially. You assume that the project will have only 3-4 tables and few updates and inserts, but as and when you gather requirements, dive deep into design , add more features, it starts to get bigger.

At later stage you wishes you had started with ORM framework else you might have to write all the inserts, updates and selects which is a huge waste of time ,considering all this can be configured easily by hibernate.

2. Performance : A lot is being talked about hibernate performance. We have used Spring and hibernate with one of the biggest deployment in clinical applications and I can tell you, I have not seen any issues or so because of hibernate.

Yes we had to fix the hqls at few places but that is a normal tuning process.

3. Hibernate is slow because it uses run time reflection:  People who had faced performance issues with reflection in early ears were skeptical about hibernate’s use of reflection. But not anymore. You should not worry about performance loss due to reflection. From hibernate’s doc

Modern JVMs implement reflection extremely efficiently and the overhead is minimal compared to the cost of disk access or IPC. Developers from other traditions (eg. Smalltalk) have always relied upon reflection to do things that C/C++ needs code-generation for.

In the very latest versions of Hibernate, “reflection” is optimized via the CGLIB runtime bytecode generation library. This means that “reflected” property get / set calls no longer carry the overhead of the Java reflection API and are actually just normal method calls. This results in a (very) small performance gain.

Read more…

How well does hibernate perform ?

June 14th, 2011 Vinay 2 comments

A lot has been said and discussed about hibernate performance.I will not go into details and benchmarks but I will share some practical insights.

Our application was developed using Spring framework 2.5 , spring webflow and hibernate 3.0. We had Oracle application server (not the oracle weblogic ) and oracle database 10g

Caching : Second level caching was done using ehcache. The caching strategy was read-only which is the simplest and best-performing cache strategy

Stored Procedures : Procs were used at couple of places. These procs had business logic and were communicating with another database through DB Link.

Native queries : We did not use any native queries.

We have used Spring and hibernate with one of the biggest deployment in applications and I can tell you, I have not seen any issues or so because of hibernate.

Yes we had to fix the hqls at few places but that is a normal tuning process.

I cannot share much details here neither the performance statistics but will be happy to answer your questions.

Gathering database statistics in oracle

June 14th, 2011 amit No comments

While with Oracle for several years there had been many instances when the database performance had not been optimal. This had nothing to with the configuration of the sever but more with tuning of database. Here are some tips which I had been using

Make sure that database statistics is upto-date. As this is one of the factor which can influence explain plan. We can gather statistics by executing following command:

EXEC DBMS_STATS.gather_schema_stats(‘TDWDBA’);

Where TDWDBA is the schema name.

Maven Surefire for Integration Tests in JUnit

June 14th, 2011 Vinay 1 comment

Maven surefire plugin is used to run unit tests during test phase of build lifecycle . The reports are generated in .txt or .xml file. These files are generated at ${basedir}/target/surefire-reports

Surefire runs unit tests during build phase, not integration tests which are executed during package phase. But you can include integration tests also to be run

Below is the configuration for surefire plugin in your pom.xml

<profile>
<id>itest</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.report.version}</version>
<configuration>
<includes>
<include>**/*IntTest.java</include>
<include>**/*IntTests.java</include>
</includes>
</configuration>
</plugin>

</plugins>
</build>
</profile>

Categories: Programming / tutorials Tags: ,

Difference between the session.get() method and the session.load() method?

June 8th, 2011 Vinay No comments

When working with hibernate, one of the most used methods would be session.get or session.load.
Let us see what the difference between these tow

Take a look at this code :

Session hSession = this.getCurrentSession();

hSession.beginTransaction();
User u = (User)hSession.get(User.class, 8);
u.setLoginName(“skillguru”);
u.setPassword(“forgetmenot”);
hibernateSession.getTransaction().commit();

session.get() makes a hit to the database to get the data if the obejct does not
exist in the application.
Session.load gets the proxy for the instance, hence saving a database trip.But if there was no such object in the database then the method session.load() throws an exception whereas session.get() returns null.
Both the methods will return the instance or a proxy for the instance, if the instance or
proxy is already associated with the session.Only difference is that the session.load()
will throw an exception if the persistent entity does not exist in the database

Get Adobe Flash playerPlugin by wpburn.com wordpress themes