Hello
Actually i am using CMP (calling from stateless session bean) in our project.
In interview :),
1)they are asking, why you are using CMP?
I told container is responsible for writing JDBC access code and Synchronization. Apart from this, they are expecting something. Could you please explain? any merits.
Other quesion is,
2)why people are not using entity bean?
Please explain. Do not ignore it. :)
Thank you
Ranjitha
-
What is the Advantage of CMP? (7 messages)
- Posted by: Ranjitha Rajan
- Posted on: July 12 2005 08:38 EDT
Threaded Messages (7)
- Advantage of CMP by Piyush Gupta on July 13 2005 01:43 EDT
- Advantage of CMP by Ranjitha Rajan on July 13 2005 03:48 EDT
- Advantage of CMP by sawan parihar on July 14 2005 05:05 EDT
- Use of instance variable in Session Beans by Jeethendriya Vangara on July 14 2005 06:12 EDT
- Use of instance variable in Session Beans by Race Condition on July 14 2005 02:21 EDT
- Re: Use of instance variable in Session Beans by Jeethendriya Vangara on June 15 2006 05:58 EDT
- Advantage of CMP by Ranjitha Rajan on July 13 2005 03:48 EDT
- What is the Advantage of CMP? by Jyothish John on July 15 2005 07:24 EDT
-
Advantage of CMP[ Go to top ]
- Posted by: Piyush Gupta
- Posted on: July 13 2005 01:43 EDT
- in response to Ranjitha Rajan
The advantage of Using CMP is
1.Our Container is responsible for implementing all persistence logic.
2.We can use all the services provided by the container like security,Transcations..etc.
3.We need not to bother if database need to be changed at any point of time,Cause our container will take care while deployment after we configure the datasource.
People are not using entity beans now a days cause the new data persistent tools are there which are easy to use and maintain like Hibernete.We can use Java dataobjects instead of entity beans. -
Advantage of CMP[ Go to top ]
- Posted by: Ranjitha Rajan
- Posted on: July 13 2005 03:48 EDT
- in response to Piyush Gupta
Thank you very much. Any advantages regarding Performance? if anything, please reply. -
Advantage of CMP[ Go to top ]
- Posted by: sawan parihar
- Posted on: July 14 2005 05:05 EDT
- in response to Ranjitha Rajan
Hello,
Although CMP 2.0 is far better that the previous versions but still it's not that good for large projects. If you are talking about small projects where the data is very limited then CMP is ok but for large projects where you want more control on the SQLs generated and where you are concerned about the response time of SQl execution you will most probably like to code JDBC.
The CMP makes sense in a way that you don't have to code the persistence logic but the places where you have many relationships it become very difficult to manage all those XMl files etc.
Further performance is again a issue. One database row will be represented by one java object. And these objects will stay on the heap and will consume memory. All the good application servers provide a way to configure that how the objects should be made (I mean to create a pool while server startup to represent all the data in the database or have limited number of object, the first approach will be very efficient but then again its a memory issue).
In the end I believe that CMP still needs a couple of years to emerge as a good technology.
Regards,
Sawan -
Use of instance variable in Session Beans[ Go to top ]
- Posted by: Jeethendriya Vangara
- Posted on: July 14 2005 06:12 EDT
- in response to Piyush Gupta
I Faced one Interview they asked me, CAN WE USE INSTANCE VERIABLE SIN STATELESS SESSION BEANS? IF YES, WHY AND HOW? IF NO, WHY AND HOW?
PLEASE REPLY IT. -
Use of instance variable in Session Beans[ Go to top ]
- Posted by: Race Condition
- Posted on: July 14 2005 14:21 EDT
- in response to Jeethendriya Vangara
Should I just show up at your office and do your work for you? -
Re: Use of instance variable in Session Beans[ Go to top ]
- Posted by: Jeethendriya Vangara
- Posted on: June 15 2006 05:58 EDT
- in response to Jeethendriya Vangara
I think it depends on our code. If we are using container specific code then no need to create instance varibles. If our code is our own specific, then we can create instance varible. But in general, in any books it is clear that no need to create any instances in stateless beans. I need get lot on this. Please reply this. -Jeethendriya -
What is the Advantage of CMP?[ Go to top ]
- Posted by: Jyothish John
- Posted on: July 15 2005 07:24 EDT
- in response to Ranjitha Rajan
Hello;
These are some of the primary advantages of CMP, which I can think of..!
1)Speed of development.!
2)Only declarative dependency to the underlying database..!
3)No code changes when switching from one db vendor to another, only deplyoment descriptors needs attention.
4)Data manipulation easy through create(), findbyXXX(), remove() methods..!
5)Container specific transactional integrity..!
Disadvantages;)
1) Findermethods() can crash the system,, imagine calling findall() on a CMP bean with 100K+ records;)
2) Resource intensive and less efficient when implementing relations;) findbymethods less eficient, you may want to go JDBC/BMP route for effectieve reporting etc..!
3;) there are another 101 more..!
Regards