Rishi Shehrawat

Ranch Hand
+ Follow
since Aug 11, 2010
Rishi likes ...
Hibernate Java Spring
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Rishi Shehrawat

You should use a ORM solution. Since you are building a platform for selling products you will have decent number of entities. Hibernate will improve productivity & help bridge the paradigm mismatch between RDBMS & object oriented languages. Also it will make application maintainable. All this will be possible if you have decent understanding of ORM which will help you avoid common pitfalls that people encounter while using ORM.

In terms of issues due to non-availability of persistence context, there are well known patterns/approaches to address this type of issues.
6 years ago
The question that needs to be asked is: Am I getting any additional features/capabilities from a J2EE server that a web container does not provide ? Also the additional features/capabilities should be used by your project.

In case you are using Spring security & transaction features will be available with Tomcat. In case you have requirements around distributed transactions, then these will not be available out of the box in Tomcat. However there are workarounds for this, you can use "best effort strategy" or could use a third party JTA provider with Tomcat. My suggestion is that you should use # 1, unless you have a specific requirement that # 1 is not able to handle.
6 years ago
The serviceCall methods are private, this might be the cause. Make these methods public & try.
Spring provides a lot of remoting options. You will need to evaluate which meets your requirement.

6 years ago
You will have to take heap dump as it will give you an idea about the type of objects that are taking up memory. Then you can look into how these objects are being created & what needs to be optimized. You can trigger heap dump by setting this JVM option -XX:+HeapDumpOnOutOfMemoryError
6 years ago
This type of behaviour is normal with OOM. When JVM encounters OOM it tries to clear memory by running full GC's. After some time if it is not able to clear up memory the JVM crashes. In case you enable garbage collection logging, you will see that full GC's are running & the JVM is not able to clear memory.

From the thread dumps it seems like you are doing something with blob, try looking into this code. In case this stack is there in all error files there is a good possibility that this is the cause. Another option is that you can ask JVM to produce heap dump when OOM is thrown. You can then look at the type of objects in the heap & how these objects are being created.
6 years ago
Finally the wait is over. Today while checking status in CertView I found out that I have passed part 2. My score is 135. My assignment was DreamCar. I finished part 2 on 29th June & part 3 on 30th June.

It would not have possible to clear this certification without the information availaible on this forum, a big thanks for the help & support.

My best wishes to every one else waiting for their result.
6 years ago
It is normally recommended to co-locate web & business layer to avoid overhead of remote communication. You should have a good reason for running web & business layer in different JVM's.
Normally in a web/app server environment, the Spring application context is loaded at startup by using a standard servlet listener. Have a look at ContextLoaderListener.
In case you are using EJB in the business layer then using Spring also sounds like a bit of a overkill to me. In case you are just using EJB as you want to run business & web layer in separate JVM's then as mentioned above you need to have a very good reason for keeping them separate as it adds overhead in terms of performance, maintainability & manageability.
6 years ago
Since the business & presentation/web layer is not co-located, they will need to use seperate Spring context. Even if they are co-located it is recommeded to keep the Spring context for business & presentation layer seperate as these two layers are different.
6 years ago

As per my understanding when console is showing generated query its hitting the database right?


Another question is why it did not generate the queries select max(id) from MyProject1.person, select max(id) from MyProject1.Address at line C and D as it should get latest max value of ID for person and address from database in case some other session inserted a new person in between?

In case there is insert by another transaction your insert operation will fail due to unique constraint violation.

Similarily why it did not generate the query select person0_.id as id0_0_, person0_.cname as cname0_0_, person0_.addressId as addressId0_0_ from MyProject1.person person0_ where person0_.id=? at line E and F .How does session come to know that person for id 2 and 3 is not updated by any other session.

Hibernate knows that the data is in session & since it has not been flushed yet to the database it cannot be updated by another transaction.

Not sure how session is behaving and how does it decide when to hit database/Generate query?

In most of the cases the inserted/updated data is written to the database on transaction commit, even if the data is written (for some scenario's) it will not be visible to other transactions till the current transaction is committed.

I submitted my essay on 30th June. My assignment was DreamCar. I had also written to Oracle 2 weeks ago, got a response saying that I should wait for another 2-3 weeks.
6 years ago
Do you have 2 different databases that requires XA transactions. Basically a situation where 2 resource managers are being used require XA transactions. In case you are already using transactions then JMS can also participate in JMS transaction. In this case the "best effort strategy" of committing database before JMS is not required. For JTA to work you need to use XA aware resources (drivers for JDBC & connection factories for JMS).
6 years ago