Friday, 5 October 2012

Hibernate doesn't see external changes made to the database either directly or through another software/application

hello Guys,

I've been looking into this issue since past one week.
I've got information about hibernate cache types and using different cache types.
I tried using ehcache for my database and decreasing the cache time for one of my entities, but it didn't worked. Even waiting for about 10 times more than the refresh period set in ehcache.xml.
I even tried using StatelessSessions. I've tried many other things also, but none of them seemed to be working.

I suffered for a week without any result.

Yesterday I was surfing the internet about the same and soon I had the idea of using a transaction since hibernate must validate the database before inserting (just come up as a thought, nothing to do with how actually hibernate works).

So I myself invented a new technique, although it'll slow up your application, but for now atleast I can go with it, instead of having a buggy feature of not showing database update by hibernate. Below is what I used:

RESULT 

Use Transaction in every select query you make along with all insert, update & delete queries.
So the main idea is to use a Transaction every time one has to query the database, no matter what type of query.

E.g.

Earlier Code :


Session sess = NewHibernateUtil.getSessionFactory().openSession();
        SQLQuery q = sess.createSQLQuery("select * from user where iduser=(select iduser from account where idaccount"
                + "=:idaccount)");
        q.setInteger("idaccount", idaccount);
        q.addEntity(User.class);
        User u = (User) q.uniqueResult();
        sess.close();



New Code :


Session sess = NewHibernateUtil.getSessionFactory().openSession();
        Transaction tx = sess.beginTransaction();
        SQLQuery q = sess.createSQLQuery("select * from user where iduser=(select iduser from account where idaccount"
                + "=:idaccount)");
        q.setInteger("idaccount", idaccount);
        q.addEntity(User.class);
        User u = (User) q.uniqueResult();
        tx.commit();
        sess.close();

Monday, 9 July 2012

Skype blocks 80 & 443 and hence prevents XAMPP & WAMP

hey! friends,

From a couple of days, I was trying and installing XAMPP but was unable to start it. I was unable to figure out what is going wrong.

I thought may I had old XAMPP version installed, so I downloaded the latest version.
But installing the latest version doesn't help. Still I was unable to start.

Then I tried a bit googling and came up with the following command :
netstat -a -b

And I came to know that skype was using those two ports, I was shocked to see that and then I searched for how to prevent skype from using those ports and the result was found in just a couple of seconds (Google is great).

I'm attaching the screenshot, so that it may help others having the same problem.


Comments are always welcome, let me know your suggestions and problems.

Monday, 12 March 2012

SCJP - Sun Certified Java Programmer




Sun Certified Java Programmer for Java Platform 1.6

How to become an SCJP within a week ?

STEPS :

LongCut (the way of knowledge) : 
1. If good in Java Core, read SCJP 6 by Kathie Sierra
2. When done read the summary of this book Summary of SCJP 6 book (my words)
3. Revise the SCJP 6 by Kathie Sierra atleast once again.
4. Now give some dummy exams.
    Dummy/Practice Exams :
         4.1 Test Lab
         4.2 Test Lab Files
         4.3 Exam Lab I
         4.4 Exam Lab II
         4.5 SCJP Trail I
         4.6 SCJP Trail II
         4.6 E-PAD
         4.6 Practice PDF
5. Again revise SCJP 6 by Kathie Sierra once again to make sure, you haven't forgotten anything.
6. Go and buy a exam voucher from a PROMETRIC CENTRE and give the exam.
7. Congrats!!! Now you are a Sun Certified Java Programmer

ShortCut(hardly 1 week)
1. Directly start with practice exams. (Download links available above)
2. Practice 2-3 times.
3. Go and buy a exam voucher from a PROMETRIC CENTRE and give the exam, you will definitely qualify, trust me.
4. Congrats!!! Now you are a Sun Certified Java Programmer




Comments are always WELCOME.

Saturday, 3 March 2012

hey, now you know what technical analysis is.
lets have a taste of   "What fundamental analysis means in Forex Trading. "

Fundamental analysis is a way of looking at the market by analyzing economic, social, and political forces that affects the supply and demand of an asset. If you think about it, this makes a whole lot of sense! 




Just like in your Economics  class, it is supply and demand that determines price.




You can relate this economic term supply and demand in forex as  if:








In essence:::


 Higher currency value    =>   Good economy => means price of currency will increase in future
 Lower currency value    =>   Bad economy  =>  means value of currency will decrease in future


Hope this will help you in figure out what is fundamental analysis means.

How to analyse Technically :::   

The key point in technical analysis is to study charts, trends,  patterns and history of market trends.


have you ever heard the old adage,     "History tends to repeat itself"












The heart of forex trading is study of chart.
You can look at past data to help you spot trends and patterns which could help you find some great trading opportunities.

we will see more detail on technical analysis in up coming post.











Learn ForEx:::
How to analyse market  ?

Well, Here is your solution  :

Three Types of Market Analysis

To begin, let's look at three ways on how you would analyze and develop ideas to trade the market. There are three basic types of market analysis:

  1. Technical Analysis
  2. Fundamental Analysis
  3. Sentiment Analysis
Three-legged stool