Mallik Hiremath

Ranch Hand
+ Follow
since Oct 20, 2002
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 Mallik Hiremath

Has any implemented a Big EJB Project with EJB 2.0 or trying to implement with EJB 2.0? if so how was the performance with EJB 2.0 CMP /CMR, I would like to hear from those who implemented the big EJB project and used the EJB CMP/CMR. Have you guys found how the 1 to M and M to M relations are handled?
We are trying to implement EJB 2.0 with CMP/CMRs with Oracle 9iAS/OC4J and have issues with CMP/CMRs and that has been discussed in this forum already just for reference I will give that url again
https://coderanch.com/t/312502/EJB-JEE/java/Has-any-one-created-CMP
Thank you
Hello All,
Can we get the stand alone client's ip address at the EJB Server while the RMI Context to EJB Server is being created and authroized?
I believe this is vendor specific, but I would like to know if any one has done this with their vendor specific API, If some one knows how to handle this please let me know.
Thank you
Mallik
Hello Marcos,
Thank you for responding!!
If you dont' mind, couple questions for you
1. Are you guys using the EJB-CMP CMRs?
2. If your answer is yes for question 1, with in your latest implementation using Weblogic, have you found out that the Container calls ejbActivates() for all those child entities of CMR relationships?
3. Could you please try to print some verbose from your ejbActivate(), ejbPassivate(), ejbLoad() and ejbStore() methods of your CMP beans with CMRs and let us know your experience with the weblogic container?
Thank you in advance
Mallik
Hello john,
Thank you for responding to my post!
Yes its really an issue for those who are trying to use EJB CMP-CMR technology. The EJB Container vendors would have put so much of thought on this before they could really code such a thing!!
But I really did not understand that why in the world the Container is trying to ejbActivate() all those child entities 1:M ( one to many relations) when the many side is not getting changed for any reason!!! Note: the many side may have 10's of 1000s or even million records in the DB. To finish such a transaction if the Container takes the time in the order of minutes its not acceptable!!! this means the EJB-CMP-CMR is not good for large systems unless otherwise they do the lazy loading and even lazy ejbActivating.
Has any one has any thoughts on this? Let us know your comments and your experiences with your EJB Containers
Thank you
Mallik
Can you give some more information on the type of EJB server you are using?
I don't know how you are passing the principal object that you get from the LDAP to the JNDI lookup, can you let us know about your JNDI code?
Below is the code that shows an example of getting the initial context to the EJB server and then this initial context is used to lookup the Beans and to execute the method calls on them
private static Context getInitialContext() throws NamingException
{
Hashtable env = new Hashtable();
env.putContext.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "admin-password");
env.put(Context.PROVIDER_URL, "ormi://localhost/ejb-application";);
return new InitialContext(env);
}
Usually while you connect to the EJB server you have to specify the username and password in the initial context and then establish the connection, then the EJB server will authenticate and authorize the user with the help of your JAAS login module. So its your responsibility to code the JAAS (if one is not provided by the container) and then the EJB container will call your login module to authenticate and authorize the user to lookup or execute a method on an EJB.
Usually the EJB container vendors specify how the EJB container calls the JAAS login modules and how to configure JAAS modules with in the J2EE containers, so you have to go through your vendors documents to get JAAS configuration information.
--Mallk
It looks like no one wants to comment on the usage of CMP EJBs with CMRs on large Databases!!!
I think I have to discard the inbuilt CMR provided by the container and have to code the CMR for myself, this would give me the control of loading or not loading the childern entities depending on the needs.
Did any one code the CMRs for yourself? what are the pros and cons of coding the CMRs for ourselfs? let me know, thanx in advance!
--Mallik
Thank you very much Tim,
At least I got some answer from you!!!
Does any one else has to say any thing about the EJBs in large systems and your experience with EJB (both CMP and BMP ) with and with our CMR relationships in large system?
Thank you
Mallik
Thank you Lasse,
Yes, I know the env-entry tag, but every time I have to compare with some thing I need to lookup the JNDI, does any one is this an expensive statment?
Does any know how to specify constants that is applicable to all the EJBs in the application?
Thank you
Mallik
Common guys some one let me know if you ever used CMP EJBs having CMRs in a Databse having large number of records i.e in the order of 10,000 records to 100,000 records or even 1 Million records? Or Is every one using CMP EJB just for fun or just for Toy Programs?
-Thank you
[ September 19, 2003: Message edited by: Mallik Hiremath ]
Just refreshing the question.
The problem is that, OC4J thinks that I will use the other 10,000 Employee Beans for some other purpose and hence it starts calling ejbActivate() method on these 10,000 beans one bean for each db record!!!
While the setDepartment(dept1_Local)is being executed the CPU is at 100% full and memory consumption of the OC4J shoots up by 25 MB, this is just to add one employee!!! think about adding 10 employee to the DB.
This is on a machine having 512 MB or RAM and 1 GHz CPU.
Does every vendor implement the CMR relationship setting like this? Does any one tested the EJBs with CMR relations in a DB having large number of records ( say 10,000 to 1 million records ) ??? Does any one used EJBs in such an environment?
Thank you
-Mallik
Thank you Danl,
Do you or some one know the best method of populated the JNDI env namespace? or suggest some pointers?
Yes, You are correct
In API 2.3 the sessionDestroyed() method is called just after the Session was invalidated
In Servlet API 2.4 the sessionDestroyed() method is called just before the Session is getting invalidated (means you can still get a reference to Session )
I don't know which API you are or planning to using!!

-Mallik
Assuming that you are talking about the HttpSession, you can use the sessionDestroyed() method and implement your functionality, because the sessionDestroyed looks like its being called just before the session is invalidated, from with in this method you can get hold of the HttpSessionEvent from the session event you can get the Session Object and get those values which you have stored in the Session
V 2.3 API says:
sessionDestroyed(HttpSessionEvent se)
public void sessionDestroyed(HttpSessionEvent se)Notification that a session is about to be invalidated.
Parameters:
se - the notification event
-Mallik