Sandeep Lodhia

Ranch Hand
+ Follow
since Oct 09, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sandeep Lodhia

[Edited by the moderator]
[ May 27, 2004: Message edited by: Ajith Kallambella ]
Hi,

Is there any place where I can find all links for free downloads of books???

http://faq.javaranch.com/view?SunCertifiedEnterpriseArchitect is a good link but am looking towards free downloading of books related to SCEA-I.

Thanks in anticipation and Cheers,
Sandeep.
Yes. Thats correct. For 1st bean, I had specified timeout of 60 sec. 1st bean calls method of 2nd bean. No time-out specified for 2nd bean.(So default remains to be 30 sec).2nd bean in turn calls another beans.
I was expecting that 2nd bean should not time-out before 60 sec. But it timed-out after 30 sec.
I'd make it more clear.
In weblogic-ejb-jar.xml ,FOR 1 SESSION BEAN, I specified following :
<transaction-descriptor>
<trans-timeout-seconds>60</trans-timeout-seconds>
</transaction-descriptor>
My initial understanding was the time-out of 60 sec is applicable to all other beans also that take part in trannsaction. But later found that its not the case.
And for all beans, the transaction attribute is specified as follows in ejb-jar.xml :
<trans-attribute>Required</trans-attribute>
I am looking for details on why the time-out period is not applicable to other beans in transaction.
Cheers.
Hi,
PLEASE REPLY TO THIS ASAP.
I understand that <trans-timeout-seconds> specified for any bean is applicable to that bean only and not to other (beans)/(methods of other beans) taking part in that transaction.
Can someone please provide me detailed explanation on this? Or may be some website that would have an explanation.
Earlier, I had an understanding that just like transaction scope, the time-out specified for 1 bean is also applicable to all beans taking part in the transaction.
Also, pls let me know what is the default transaction type if not specified any explicitly. Is it Supports?
Thanks,
Sandeep
[ March 05, 2004: Message edited by: Sandeep Lodhia ]
[ March 05, 2004: Message edited by: Sandeep Lodhia ]
Hi,
In my project, I'd be accessing EJB(stateless)across the firewall, i.e. EJBs would be deployed in some other server.I'd access this server through network.Moreover there will be firewall.Communication between two networks is possible by opening ports.
My question is :
1. Can i cache home or remote reference once i get it from other server across the network?
Pls note that there are no security credentials on the EJB's. So there is no authentication.
Cheers.
Sandeep.
In Our application,we have only stateless session bean.Hence we r caching remote ejbobject.
So the code for it is as follows :
public EJBHome getHome(String jndiHomeName, Class className) throws Exception
{
EJBHome home = null;
try{
Context initialContext = null;
Object objref = null;
try
{
initialContext = new InitialContext(System.getProperties());
objref = initialContext.lookup(jndiHomeName);
}
catch(Exception localExcep)
{
//code for exception
}
home = (EJBHome)PortableRemoteObject.narrow(objref, className);
}
catch (NamingException ne)
{
throw new MyOnstarSystemException(ne);
}
catch (Exception e)
{
throw new MyOnstarSystemException(e);
}

return home;
}
The problem is, above method returns EJBHome and not specific bean home.So i cant call create() on EJBHome.I need to have specific home say, AdminHome.
So how can I get specific home in generic way !!!
1 solution is, according to jndiHomename passed as method parameter, i create specific home object.
Pls let me know if there is any other solution.
Thanks.
Perfect reply Andy.I understood it completely !!!
U cleared all of my doubts for singleton pattern !!!
Guys,
1.First help me in understanding how multiple,SIMULTANEOUS requests for singleton class are handled.
I have a singleton class with NO METHODS SYNCHRONIZED.
Scenario : 1 request is already accessing a method A().Before 1st request has finished processing, 2nd request for same mathod A() comes.
Will 2nd request be put in a queue till 1st request is over?
Single instance of class would mean single instance of all its variables and methods.Then how simultaneous requests are handled in multi-threaded environment.
2.Purpose behind making DAO and Service classes is improvement in memory performance.Since there will be only 1 instance of each class,number of objects across application will be very less.
3.Pls suggest me explanation or link for disadvantages of using Singleton class WITHOUT SYNCHRONIZED CODE in it.
Thanks.
Sandeep.
[ June 04, 2003: Message edited by: Sandeep Lodhia ]
Hi,
I know when to use Singleton Pattern.
But I am not sure of how multiple,simultaneous requests are handled for singleton class.I have following 2 questions :
1. There is no synchronized code in my Singleton class.And suppose 1 request is accessing this class.At the same time,another request for this class come.Is the 2nd request queued till 1st request is over?
2.I believe that simultaneous request can access singleton class simultaneously.Hence in any application, all classes like service classes, DAO classes, except EJBs, should be singleton. This will improve memory perfomance as number of objects are significantly less.
Pls correct me if I am wrong.
Thanks.
Sandeep.
Hi,
In any application, can I make all Child DAOs class as singleton.All these children will extend Base DAO which will manage connections.
In the same way, can classes that serve purpose of service be made singleton.
My basic doubt is....in singleton pattern, how multiple requests are handled ?
If 2 requests try to access a singleton class simultaneously, how are they processed as there is only 1 instance of the class?
Thanks.
Sandeep
Hi,
In our project, we are accessing few EJBs that are outside our firewall.The class, which does the lookup and returns me remote reference, is static class and checks whether reference is already created or not.If yes, then same reference is returned.
When i make second method call on same bean using the cached reference, I get security violation exception.
Any solution?
Thanks.
Sandeep.
22 years ago
Congrats Buddy !!!
And All the best for future !!!
Guys...its not working with me.I have jdk 1.4 .
Following is the error :
java.lang.NoClassDefFoundError: javax/swing/JProgressBar
at
at com.zerog.lax.LAX.launch(Compiled Code)
at com.zerog.lax.LAX.main(Unknown Source)

Help me out.
Sandeep