Win a copy of Rust Web Development this week in the Other Languages forum!

david long

Greenhorn
+ Follow
since Apr 16, 2001
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 david long

Hi, everybody
I just wonder where I could get weblogic server which is free, long term using and supporting EJB 2.0. You may know the 30 days evaluation verson of weblogic 6.1 is too short for me to get along with it.
Thanks in advdance.
David
19 years ago
Hi, fengzixuan zheng
try putting your drive jar file into D:\J2SE
/jre/lib/ext directory, so and you even don't need use classpath for your driver.
if 'ext' folder no exsit, make one.
Hi stowe
1. Try to use your path like this: C:\WINNT\system32;C:\WINNT;c:\jdk1.3.1_01\bin;c:\j2sdkee1.3\bin;c:\ant\bin;
2. Go to C:\j2skee1.3\bin folder, in the begining of all batch files, add the following to all batch files in this folder.
SET JAVA_HOME=c:\jdk1.3.1_01\bin
SET J2EE_HOME=c:\j2sdkee1.3\bin
3.Go to C:\ant\bin folder, do same thing as stated as 2.
I help this will work.
David
Hi Zhou
The packing of two jar files is definitely no problems. I did same as you did. Because sever.jar supposed to run in difference computer or node, you are not able to use class path to get you reference you wanted.
What I did was that client.jar includes also the some classes i needs in suncertify.sever package. Therefore i no need to use the classpath to refer to skb class or other class.
Hi Douglas Kent
I did not identify any connection because lock/unclock are the methods to ensure threads race safe. in order to do this, i just make the Data class only have one instance to all connections by declare static in server.
I could give you the whole set of examples how the method block the other connections below, which may inspire your some thought. Pls note that the example is not thread safe and could not use as real one, it just demonstrate your concerns
inData class:
private static boolean[] lockList= new boolean[recordCount+1];
//above lockList array auto initialized all false;
private static int recordUser=0;
public void lock(int record)throws DatabaseException, InterruptedException{
if(record==0| | record>recourdCount) throw new DatabaseException();// change the IO exception to DatabaseException will make you code ease
//whole database lock, lockList[0] reserved as database lock
if(record==-1) {
while(lockList[0]) //first, set databas lock true as soon as possible
sleep(100);
lockList[0]=true;
while(recordUser!=0) //second, check if any user there
sleep(100);
}
// individual record lock
else {
while(lockList[record] | | lockList[0])
sleep(100);
recoerdUser++;
lockList[record]=true;
}
}
public void unlock(int record){
if(record==0 | | record>recourdCount) return;
if(record==-1)
lockList[0]=false;
else{
recordUser--;
lockList[record]=false;
}
}
In the server, the applying of lock/unlock methods in server side like this;
static Data dt;
......
public DataInfo getRecord( int record) throws DatabaseException, RemoteException{
DataInfo di;
boolean exceptionOccured=false;
try{
dt.lock(record);
di=dt.getRecord(record)
}catch(InterrruptException){
exceptionOccured=true;
}finally{ // very important
dt.unlock(record);
if(exceptionOccured)
throw new DatabaseException(); //all exceptions must be rethrow after unlock method called
}
return di;
}
Remmber this is a demo for how to apply block different connection, it should be no hints or tempting to use it. It need rework to make it thread safe, I did not directly use it in my code.
David

[This message has been edited by david long (edited April 19, 2001).]
Hi Peter
I just do not understand why you give that code to improve yourself understanding the Vector tread-safe. How did you know people will mis-use the code like that to claim its thread safe for locks. Obviously, you mis understanding the meaning of thread safe of Vector.
Remmber this point. When we say a Vector thread safe, it means the data stored in vector a thread safe, do not expands the idea to outside Vector, Ok. It do not mean the lock/unlock the database a thread safe, which depends on how you apply the lock/unlock on database. However it is first step to make your locks data thread safe, which have many ways and someone may code two idea together while someone not.
If you try to claim your code on whole data base to impove your point(un-threadsafe vector), then you mixture the vector thread safe with database thread safe. If not, I really do not understanding what you trying to say.
You really do not understanding how was the vector collection sun created for, you expend vector too much to claim your point, that was really ashame.
David
Hi missy
I used a frame class, which had all GUI components, two model classes to hold all the data that GUI need, and a command class had all fuctionality or commands related event listenners. From this whole picture, you may say I applied MVC architecture in my design, but I would rather to say i used a command design pattern.
Well, the requirement of spec, I thought, was ask us to leave enough room for later enhancement of our GUI design. If this enhancement occured later, the GUI will not supposed change too much, i.e. not so changed that will cause user too much difficult or unconfortable to use the new one (disrupt the user). So you design need leave the enhancement's room in advance. For example, when you add a small button and its fuctionality, the whole picture of GUI should not changed. This is basic design rule applied to all software design.
David

[This message has been edited by david long (edited April 16, 2001).]
Hi missy
I think all swing components are MVC components, which is no problem. The basic idea, I think, is how we use the advantage of the MVC, rather than to apply the MVC patterns.
However, in order use MVC, you need to implement the model data structure. My solution basiclly like this, a class called TableModel to store and update the table contents, another class called ComboBoxModel to update two ComboBox List. Those two classes all extends the default model class of these two swing components.
Hope this will help
David
[This message has been edited by david long (edited April 16, 2001).]
Hi Ruilin
According the spec, you need access the Data class locally, this should be no doult, I think.
What I did was very simple, local access class just implemented the remote interface as the server but without remote exception.
hope this will help
David