Umakanth Godavarthy

Ranch Hand
+ Follow
since Nov 10, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Umakanth Godavarthy

Hi Amritendu,
For the 1st Q, I'm inclined towards answer 'C' than 'B' because Certificate class is NOT 'closed' for modification (changes frequently) that can also cause issues when extended, hence violates 'Open closed principle'.
I'm not quite sure if the information in the question is sufficient to arrive at answer 'B' as it is not clear whether you are inheriting Certificate to be used in a higher level module to violate 'Dependency Inversion'.

As I understand, avoiding 'rigid' design is the basic idea behind all the design principles.

Can you please explain.

Thanks.
Incredible score Umesh! , Congrats!
13 years ago
It's been really a good experience in learning EJB 3.0 architecture.

Initially I started with Mastering EJB 3.0, the book is good in terms of understanding the concepts with lot of theory.
Some topics are covered in real detail, but it is not enough for JPA and some other topics from exam point of view.

I then switched to EJB 3 in Action just for JPA, because it has about 4 chapters completed dedicated to JPA.
I liked this book in terms of being bit lucid in its explanation. The initial chapters on session and MDBs were also well covered.

Then I purchased Enthuware EJBPlus and gave 1 mock exam, it was an eye opener. Some topics were not covered at all in the books like Exceptions, programming restrictions like operations allowed in beans, APIs suported by Containers, EJB Roles, Interceptors, Persistence Context propogation, Application-managed(JTA & resource-local EM)/Container Managed persistence context in deail etc.

After this, I focussed my learning by strictly sticking to the JSR 220 specs for core and JPA. I read only the chapters that were relevant to the exam objectives.

Core Spec Chapters: 2, 3, 4, 5, 12, 13, 14, 16, 17, 18, 19, 20 and 21
JPA : 2, 3, 4, 5, 6, 8, 9, 10.

I would like to thank Enhtuware for preparing such an excellent set of questions. Some questions makes you to think really hard, especially on exceptions.
I thoroughly enjoyed my prep with Enthuware.

I would like to thank this forum and its memebers for providng an excellent platform to learn and discuss different questions.

All the best to others who are taking this exam.
13 years ago

why,aMethod's transaction attribute is REQUIRED ?



This is because aMethod is overridden by ABean and the default TransactionAttribute is "Required" for beans with CMT.

Further, what this rule says is transaction attributes are not inherited by the subclasses.

Hope this helps in your understanding.
The path expressions are clearly defined in ejb-spec (JSR 220) for JPA in section 4.4.4:

"single_valued_path_expression ::=
state_field_path_expression | single_valued_association_path_expression
state_field_path_expression ::=
{identification_variable | single_valued_association_path_expression}.state_field
single_valued_association_path_expression ::=
identification_variable.{single_valued_association_field.}*single_valued_association_field
collection_valued_path_expression ::=
identification_variable.{single_valued_association_field.}*collection_valued_association_field
state_field ::= {embedded_class_state_field.}*simple_state_fi"

The association fields are also part of the persistent state (driven by cascade element of the association) of an entity.
An important thing to note is JPQL is defined for an entity and its persistent state and NOT for transient or static fields.

So in this sense, the statement in EJB3 in Action is loosely defined for group by clause.
"reentrant" means a multi-threaded environment where a method can be executed concurrently by different threads. This is not applicable to MDBs as everytime a message listener method is executed (or a timer callback) a new instance is picked up by the container from the pool.

Hope this answers.
The best way to look at it is, given the choices, either you have to select 1 or skip the Q...
The ejb-spec (section 16.4.1.3, page 413) says:"To support this case, the container must only inject a value for the environment entry if the application
assembler or deployer has specified a value to override the default value. The env-entry-value
element in the deployment descriptor is optional when an injection target is specified. If the element is
not specified, no value will be injected. In addition, if the element is not specified, the named resource is
not initialized in the naming context, and explicit lookups of the named resource will fail."
So it is clear that if env-entry-value is not specified it doesn't bind to the naming context.
But the below statement in the spec (section 16.4.1.2, page 408): "This may be done by means of the EJBContext lookup method or by direct use of the
JNDI interfaces. The environment entries are declared by the Bean Provider by means of annotations on
the bean class or in the deployment descriptor."
This is bit contradicting to the previous statement as, if env entries are not specified in DD it is not accessible though context lookups.
Hi dema rogatkin,
My post was not to offend you in any way, i just wanted to analyze the soln given by you. Moreover we do support an XML output for our application, but thats a different codeline.

Other solutions for having request parameter/form hidden field seems to suggest that I may have to simulate session tracking. But we have lot of pages and lot of URLs, it's a tedious job to append this windowid for every URL. Anyways, thanks all for you inputs, if any other solution that will be a great help.
-thanks
18 years ago

It indicates 3 instances of the servlet will get create on the loading of servlet


Dipali its wrong, it doesn't indicate the number of instances. Only one instance will be created unless it implements SingleThreadModel, in which case it depends on container how many instances will be created.
18 years ago
From Servlet 2.4 spec

The element load-on-startup
indicates that this servlet should be loaded (instantiated and have its init() called) on
the startup of the Web application. The element content of this element must be an
integer indicating the order in which the servlet should be loaded. If the value is a
negative integer, or the element is not present, the container is free to load the servlet
whenever it chooses. If the value is a positive integer or 0, the container must load
and initialize the servlet as the application is deployed. The container must
guarantee that servlets marked with lower integers are loaded before servlets
marked with higher integers. The container may choose the order of loading of
servlets with the same load-on-startup value.

18 years ago

Just install a little hook which will provide unique user agent for every instance of a browser.



what do you mean by hook, it doesn't seem to be a practical solution. we cannot expect every client machine to install this hook or whatever.
18 years ago
These two are contradictory statements:

So, whether there is one browser instance or multiple browser instances for a session, it is still the same session as all the browser instances share the same cookie.



and

I haven't tried it, but I would think that to get a separate session per browser would require the user to log in again using a separate browser instance.



Let me elaborate the steps I follow for this scenario:
1. Open two browser instances (not by doing ctrl+N)
2. Open login page for the app.
3. Login by specifying the username/passwd
4. One of our servlets prints the sessionid as html comments, so that we can see the sessionid being generated.
5. Getting the same sessionids in these two instances of the browser.
6. Now, if i log out and login from any of the instances, it generates different sessionid.

Any more thoughts or inputs on this.
-thanks
18 years ago