Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

deepak yadav

+ Follow
since Oct 04, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by deepak yadav

I have 2 methods in my EJB, testA and testB. I have to invoke testB from testA and that I can do in 2 ways:
i) directly invoke testB from testA, like a class method
ii) create a remote object of this EJB and then invoke testB on this remote object
Is there any difference between the two in the way
o transactions are handled
o underlying security framework applies restriction
o any other thing apart from probably less overhead in (i)
I am using WLS 8.1 SP1 and the following code snippet in a jsp
a<%=(new HashMap()).get("abc")%>b
gives output on browser as
This wasn't the case on WLS 6 (i think so, though not very sure) where
it gave output as
19 years ago
HTTP is a not a push kind of protocol (server can't send anything anytime at will), so u can't do that. Only thing possible is to have refresh meta tag with very low timeout (say 3 seconds)
19 years ago
could u please add more details to your query, like which app server, what kind of authentication u r using, etc.
19 years ago
request and response are separate objects, if you are setting something in response u can't get it it out from request within same piece of code.
The reciever will get this response as request and would be able to get this thing out from the request object.
19 years ago
Hi Hill,
java.sql.Date does have the time component but it is better not to use it because it has been deprecated long ago. Also i had problems using java.sql.Date in CMP (WLS 8.1). The time component wasn't appearing in the database(Oracle 8i), but when i used java.util.Date or java.sql.Timestamp it worked fine.
This is from 1.3.1 javadocs
public int getHours()
This method is deprecated and should not be used because SQL Date values do not have a time component.
I faced similar situation. CMR fields are updated in postCreate() but if the CMR field also happens to be a primary key then you have to set it in the create() directly (by using setCustomerId(..)) i.e. the setter method of that CMR field (setCustomerProfile(CustomerLocal ..)) is never used and the getter method would fine.
I am replying on the basis of the subject, the contents of the post didn't revealed that the actual problem is with java.sql.Date
java.sql.Date doesn't have a time component, so there is not much point in making an instance of that using a time precision of miliseconds
that int to Integer thing worked.
Hi Lasse,
that isn't the answer I am looking for. I have foreign keys which can be NULL but the portion you pointed is talking about delaying database insert because of NON-NULL foreign keys.
In one of my table, there are few foreign keys (of type NUMBER) which can be NULL. I have a CMP for that table and no value is set for the attributes corresponding to the foreign keys in its create method. During the invocation of create, it is throwing Constraint Violation on this Foreign Key. On decompiling the container generated code for this CMP, I found these values being set to 0. Is there any solution for this problem.
(I am using WLS 8.1, EJBGen, Oracle 8, EJB 2.0)
Hi Lasse,
could you elaborate a little over the code in memory thing your mentioned.
AFAIK only a single copy of code is present in memory and there can be any number of object instances. So the size of an object of class EJB_A (in memory) should be same as size of object of class EJB_B (no matter how much difference is in the size of code as long as they have same type/number of global variables)
Thanks for replying
Self Certified Programmer for Java 2 Platform
would like to add few more things...
I don't doubt over OO design and having use case define the granuality, but would like to have a some practical insight into it.
I want to serve about 1000 requests concurently for each kind of functionality my application provides. Say I have 6 functionalities and and I code 6 different stateless session EJBs (with say 400 lines of code each) with deployment order of 1000 each. So now I have 6000 EJB objects in my pool.
Would it be better to club the functionality in say 1 EJB and have the deployement order of 6000, which would help if the number of requests exceed 1000 for a particular functionality. Or may be I can reduce the deployment order and save some memory (My app server would have several other applications with lots and lots of EJBs within same container (don't ask me why because i don't know )
(I am using weblogic 8.1, that is just for some info... it shouldn't make any difference)
I am having an application which is still in design phase and we have deciding on having the business logic in a number of stateless session EJBs Vs a 1 or 2 of them. I want to know if there are any kind of issues (performance, etc) in having a single (or few) EJB(s) with all the code instead of multiple EJBs when all the EJBs are to be deployed in same container.
The only benefit I see in using large number of EJBs is that work can be divided easly if there are more number of developers and ofcourse if code size is large then ease of maintenance.
Please note that i am not talking about EJB pooling, to make it clear with an example
why would I have stateless session EJBs: EJB_A, EJB_B, EJB_C, EJB_D with 1 or 2 methods each when I can club the functionality in an EJB called EJB_ALL.
i posted a reply but it didn't appeared even after 7 hrs so posting again
the code goes here
// ---------- start of code -----------
import java.awt.*;
import java.awt.event.*;
public class FrameExample implements MouseListener {
private Frame f;
private Panel p1,p2;
private Label l1, l2, l3;
private Scrollbar s1, s2, s3;
private TextField t1, t2, t3;
private Button b1;

public FrameExample() {
f = new Frame("Hello Out There!");
p1 = new Panel(new GridLayout(3,3));
p2 = new Panel();

l1 = new Label("Red");

l2 = new Label("Blue");

l3 = new Label("Green");

s1 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 50, 0, 255);

s2 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 50, 0, 255);
s3 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 50, 0, 255);

t1 = new TextField(0);

t2 = new TextField(0);

t3 = new TextField(0);

f.add(p1, BorderLayout.NORTH);
p2. setBackground(new Color(0, 0, 0));
b1 = new Button("Close");
f.add(b1, BorderLayout.SOUTH);

public void launchFrame() {
f.setSize(170, 170);
f.setBackground (;

public void mousePressed(MouseEvent e) { }
public void mouseReleased(MouseEvent e) {
Object obj = e.getSource();
if (obj instanceof Scrollbar ) {
if (obj == s1) {
t1.setText("" + s1.getValue());
if (obj == s2) {
t2.setText("" + s2.getValue());
if (obj == s3) {
t3.setText("" + s3.getValue());

p2.setBackground(new Color(s1.getValue(), s2.getValue(), s3.getValue()));
if (obj instanceof Button ) {

public void mouseClicked(MouseEvent e) { }
public void mouseEntered(MouseEvent e) { }
public void mouseExited(MouseEvent e) { }

public static void main(String args[]) {
FrameExample guiWindow = new FrameExample();
// ----------- end of code ------------
if the code written in mouseReleased method is moved to mousePressed method , things work fine. i am using jdk1.3.1_01 on win NT
21 years ago