sundar katluri

Greenhorn
+ Follow
since Dec 14, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sundar katluri

according to spec entity beans can be pooled that means mutiple customer#420 's will be avialble in the pool


small correction to above statement
When an entity bean is in the pool it has no identity ( I mean #420 is not associated with it)when the client1 and client2 issues find primarykey
customer#420 associated with client1 and client2
thanks for the reply
I did understood little bit now

Your understanding as well as HF's illustration are correct. The spec leaves it
to the container to handle this (possibly during deploy-time customization).
The container can choose to have two distinct bean instances,
one for each client. This allows the transactions (initiated by the two clients)
to run in parallel. The container synchronizes the instance state with the
persistent store and vice versa at the beginning and end of each transaction.


what i understood from the above lines are

1. since entity beans are also pooled and bean state will re-loaded
when a business method is called(with ejbActivate()/ejbLoad() mechanism)
with this in mind when the client1 and client2
request customer#420, an instance will be returned
from pool(or new instace will created)
and howz those instances are synchronized is left to the vendor depending on transactions

is my understanding right for point#1?
Also you said 'deploy-time customization' ,It will be greatfull to me if you expand this topic littlebit(or guide me where to look in this spec,sorry to trouble you)

but still i am confused about following line(s)


On the other hand, the container may also choose
to have only instance for all the invoking clients
and serialize access to this instance. Therefore,
while one client is using the instance in a transaction, the other client will wait


serialize access to one instance? this is clearly voilating entity bean life cycle right??(according to spec entity beans can be pooled that means mutiple customer#420 's will be avialble in the pool and as i mentioned in point 1.)
sorry to give you guys trouble but i really want to straighten up my concepts before leaving HF pg 99
please re-direct me correct page number in the spec atleast!!

thanks for your co-operation
Hi,
I am new to EJB
I was reading page 98-99 and i am confused
I would appreciate if you some body help me to come out of this confusion

I got following points before (I got them before I read HF)

1. An instance of enterprise bean are never shared between the clients
That means Enterprise beans are not multi threaded

2. stateless session bean instances are pooled
and container may/may not create statless bean instance for each client (that means they can be shared between the clients,same instance can be served from getting the pool)


3. statefull beans instance are created for each client (instances are not sharable
and will be activated or passivated if necessary)

4. Entity Bean instances are created one for each row in the db
and cannot be shared between the clients
that means Customer#420 instances will be retured to client1 and
and second instanceof customer#420 will created for client2


So I assume I understood 3 points correctly by reading HF book pg 98
but 4 th point is scary and completely opposite in HF?
HF says Entity beans may be shared (for exampe client 1 and client 2
can share Customer#420 instance ) and this is against point 1 mentioned
above. What am I understanding here? I am totally confused
I basically followed this forum's suggestion(s)
I missed lot of questions on patterns,structure of web deployment

1. go through HFS(read twice) and prepare some quick reference notes
2. I did some mock exams(1.3) but they are little bit useful and not at all useful for new topics
for the following reasons
a. dont memorize all web.xml elements new exam concentrates on concepts not on memory only remeber few of them--> HFS will guide u.
web.xml order not important in 1.4 (see spec)
b. single thread model is depricated
so becareful while doing such exams..
3. take HFS mock exam(doing good score here is imp)
4.if you have time ,go through jsp 2.0 spec and jstl 1.1 spec
to get some extra knowledge
5. give importance to design patterns,i missed lot of questions on this(its last chapter in HFS ,i skimmed while reading second time)
6. i found Gijju notes usefull

Gijju notes
Hi,
Thanks to HFS Team and all of you

Cheers
sundar
I just tried this it worked
i guess first question ,they asked wrong
Which of the following directives are applicable only to tag files?
but it should be
[B]Which of the following directives are applicable to tag files?

I mean they need to remove word 'Only' in the question
if the bean exist and property does not exist -- throws run time exception (at least in tomcat). I have seen several posts in this forum that says the above statement is correct and errata is wrong.
I am confused now !! which is one is right?I greatly appreciate HFS authors if they could clarify this doubt


Thanks
I understand this question may be for learning towards JSTL and EL but still
how do we write it? .. may be it is discouraged to write this much code in
jsp (I mean we use servlet for this purpose) and call only jsp with ${sessionScope.userName} kind of syntax ... what do you say guys??
I got the same question while checking the answers (coffee cram) on HFS!!

Is this question formatted wrong??
ofcourse
"doFilter() is not necessary if a filter
wishes to block further request processing." --> this is correct
but the question here is "giving chance to other filters in the chain" that is only possible if you call chain.doFilter(req,resp).
am I wrong?
once it did for me too.

I use Tomcat 5.5.4 now ,I deleted generated class file in the following directory(be careful though)

<your-tomcat-install-dir>\work\Catalina\localhost\<your-web-app-name>\org\apache\jsp

you may be having similar structure ... try


point 1:
------ read these lines from java api ---
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination can differ from those used to decide whether to encode a normal link, this method is separated from the encodeURL method
------ end java api-----
so behind the scene there is a diference! I think if you want to know actually what's happending behind the scene and what logic they need to determine whether the session ID needs to be encoded in the URL?

Answers for those kind of questions i dont know may be some one in the forum needs to help me/us.

point 2:

As far as i know we need to declare the HttpSessionActivationListener in the DD.
think this way --> session can be passivated and activated(in a distrubuted app session migrates!!) and its a call back mechanism provided to us to do our work
Why do you think this is wrong???


let me know if i am making any wrong assumptions for myself
u r right ,page directive get prcedence

see errata here
servlet's once instantiated will be there for-ever in your container.(I mean until u stop sever /server crashes/explicitly u remove servlet from container)
destroy method will be called only when server is going down (that is its a call back method).
By default only one instance of servlet exist in your container (unless u specifically tell the container i dont want single instance by implementing SingleThread Model).
Hope this helps.

Thanks
Sundar
Hi guys,
i was reading through HFS
then i confused about http-method element in web-resource collection

the book says on pg 634
if there were No <http-method> elements in the <web-resource-collection>,it would mean that NO HTTP Methods are allowed,

but errataweb page says

"If there were NO <http-method> elements in the <web-resource-collection>, it would mean that NO HTTP Methods are allowed, by ANYONE in any role."
should be:
"If there are NO <http-method> elements, in the <web-resource-collection>, it would mean that ALL HTTP Methods are allowed."

I trust errata rather than printed book because its being regulary updated

but on pg 635 again Lower box, 1) point(after 4 th paragraph)
"Do not specify ANY <http-method> elements in the <security-constraint>
which means that ALL methods are constrained"

i am totally confused .. is it allowed or constraint??
can any body help me out of this?
I would like know 2 conditions
when
1. no <http-method> specified
2. <http-method /> is empty
what will happen in both cases ,
It would be great for me if you answer those questions


thanks
sundar