This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.

ricky wong

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

Recent posts by ricky wong

Dear all,

Have you enabled the PreTest options (Existing / New Connection) in Websphere Application Server DataSource Property before? Is any overhead added to WAS? In case, if the Connection Pool Manager gets a invalid db connection (during PreTest stage), will it retry to get another db connection again and again until it gets a valid db connection? If yes, can we say that this PreTest option can guarantee to get a VALID db connection from Connection Pool? Could you share your experience to me? Thanks in advance.

Best Regards,
Ricky
15 years ago
Dear all,

Our company has a IBM HTTP Server (IHS) and Websphere Application Server (WAS). A web application is deployed to WAS and all HTTPS requests from customers are passed through IHS and then to WAS.

Is anyone know how to configure the "ExpiresByType" setting under "Directory" tag in httpd.conf in IHS for caching the some static objects (e.g. jsp, css, javascript) which are stored in WAS? The static objects are deployed in a EAR file in WAS.

Appreciate if you can reply asap. Thanks in advance

Thanks.
Regards,
Ricky
15 years ago
Hi Jan,

Thanks for your reply. In our case, after changed the tnsnames.ora in Oracle client, we also restarted WAS to refresh the DB connnection pool. In addition, the tnsnames.ora was also configured to use "DEDICATED" in CONNECTION_DATA parameter. So in our understanding, even the problematic oracle listerner was up again, there should be not possible that any db connection was connected to such problematic oracle server. But it was the fact that some db connections were still connected to such problematic oracle server. Do you know why? Thanks in advance.


Thanks.
Regards,
Ricky
Hi Jan,

Thanks for your reply. From your statement "If connection check would have been configured, a Websphere restart should not be necessary.", it means thas WAS should be restarted if it is not configured to validate the DB connection but tnsnames.ora is changed. Am I correct?

There was an accident happened in our testing environment before that due to one of Oracle server (in Oracle RAC env) was hanged up, our Oracle DBA commented such Oracle Server Address entry in "tnsnames.ora" to avoid any db connection to connect such problematic Oracle and also stop the listener of such Oracle server. Then the application team restarted WAS to refresh the new tnsnames.ora setting. But after that, the stopped Oracle Listener was suddenly brought up again and it was found that some db connections were connected to such problematic Oracle server. We were confused why such Oracle Address entry was commented in tnsnames.ora (=> it should not connect to this problematic Oracle server even its listener was started) but some db connections were still connected to this problematic Oracle successfully. We are not sure the root cause whether is related to any setting in WAS, JDBC or Oracle (e.g. in RAC).

Although it was happened in testing env, it should be also happened in production env.

Appreciate if you can help and give me more details or direction.

Thanks.
Regards,
Ricky
Dear all,

I am a production application support. A new application (websphere + oracle RAC) will be on production later, it uses OCI driver and websphere connection pool for JDBC connection. Our application development team tells us that if any change in ADDRESS entry in tnsnames.ora file of Oracle Client, we need to restart websphere application (refresh the connection pool) to refresh the new tnsnames.ora setting in JDBC connection. The datasource setting in Websphere does not have any connection validation configure. Does it mean that the connection pool caches up the setting in tnsnames.ora. Could anyone tell me it is correct or not? Thanks in advance.

Thanks.
Regards,
Ricky
Thanks. Yes, I don't have any tool except I have an user account to view the application / websphere logs with read-only access. Since we have hardware load balancers which forward the http request to different websphere instances, I am not sure whether customer can provide the exact target server name or FQDN (please kindly let me know how to capture the target server info from customer). So it is very difficult for me to get all 48 websphere logs and find out the problematic instance by view each log.
15 years ago
Dear all,

The production environment of my company has around 48 websphere instances (4 instances in one AIX server). If customers received an error from a particular instance and report it to us, we have difficulty to identify such problem instance? How to determine a particular problem instance? Could anyone help or give me a guideline? Thanks a lot.

15 years ago
Hi Dave,

Yes, the limited resource is man power and management concern. Management don't think our application should change for each application. It is not very reasonable.


Thanks.
Ricky
17 years ago
Hi Paul,

Thanks for your reply.

Yes, its function is similar to database. But the difficulty is if we implement this design in database, how to support N (unknown) fields with different sorting and filtering in a table. It is not possible to create different tables to support different applications respectively (due to limited resources). So I am looking for any java based architecture or solution to support our requirements.

Thanks.
Ricky
17 years ago
Hi Paul,

The metadata repository is stored in file system or other non-database system which can allow to save / retrieve data in different ordering and sorting...


Thanks.
Ricky
17 years ago
Dear all,

I need your help about the java application design:

I have a new java enterprise application project to implement a "Save and Retrieve" business function. It is to support other applications in my company to save their data and then retrieve in their data in different ordering and sorting. Those data is formated in a list of records and then can be displayed in their web applications.

For example,

Case 1. An application A1 sends a xml message to us on every 5 mins (using our Save function). The message body contains 5 fields (e.g. F1, F2, F3, F4 and F5). On the other hand, a user wants to select the fields F1, F2 and F3 within current day from our application (Retrieve functio). These fields are sorted by F4 in descending order.

Case 2. An application A2 sends a xml message to us on every 10 mins (using our Save function). The message body contains 6 fields (e.g. F10, F11, F12, F13, F14 and F15). On the other hand, a user wants to select the fields F14, F15 and F12 within this course from our application (Retrieve functio). Those fields are sorted by F10 in ascending order.

Case 3 ...
:
:

Case N ...


In order to support N applications, should I use a metadata repository store the data (since come from different applications) or store it in database?

Could you help and give me some hints?

Thanks a lot.
Ricky
17 years ago
The running order to access the Singleton DataMap by different threads in the program within a short time is :

T1 puts value V1 with key K1 to DataMap.
T2 puts value V2 with key K2 to DataMap.
T3 puts value V3 with key K3 to DataMap.
T4 puts value V4 with key K4 to DataMap.
:
:
Ta gets value from DataMap with Key K1.
Tb gets value from DataMap with Key K2.
Tc gets value from DataMap with Key K3.
Td gets value from DataMap with Key K4.
:
:

I found that Ta could not get value from DataMap with Key 1 although T1 has been run and attempted to put value V1 with Key K1 to DataMap (according to my program log).

I guess the cause may be due to T1 have not put the value to DataMap successfully and Ta attempts to get value from DataMap. Do anyone know how to control the order? Use a queue??

Thanks.
Dear all,

I have a problem. If a singleton contains a Hashmap variable and it is accessed by different threads. Different threads put or get value to/from the Hashmap through the singleton reference. At some time, a thread cannot get a value from the Hashmap although this value is stored to Hashmap with the key before. Below are the sources :

public class DataMap
{
private static DataMap uniqueInstance = new DataMap ();
private HashMap htCache = null

private DataMap() {
htCache = new HashMap();
}

public static Singleton getInstance() {
return uniqueInstance;
}

public Object get(Object key) {
return htCache.get(key);
}

public void put(Object key, Object value) {
return htCache.put(key, value);
}
}

public class TestThread extends Thread {

public void run() {
....
if (true)
DataMap.getInstance().put(key, value);
else
Object obj = DataMap.getInstance().get(key);
....
}
}

A thread T1 will put a value with a key to HashMap in the Singleton DataMap and then another thread (or the same thread) T2 will get the value by using the key after several minutes. T2 may not get a value from HashMap. T1 and T2 threads are not in the same ThreadGroup. So should I add an object lock to synchronize the method "get" and
"put"? Anyone know why and please kindly help.

Thanks.
Yes, it is defined a private variable. For the thread safe, how can I define it?
Dear all,

My MDB EJB application retrieves a MQ message, it creates a thread to handle this MQ message. This thread uses SQLJ and datasource to connect to DB2 and insert/update all data to database. When the number of MQ Messages (e.g. 10, 100) are received by MDB and the corresponding of threads are trying to insert/update its data to DB2, some of threads get an error "DSRA9110E; Connection is closed".

Each thread creates its own connection and dbcontext objects and the transaction is quite short (Only insert/update data to around 3 tables). In addition, the MQ message of each thread has a unique id. The unique id is a primary key of the tables.

As I am new to SQLJ, does anyone know what is the problem? I have tried to add logic to check whether a DBConnection is closed or not after getting it from datasource. It seems that all connections are not closed when received from datasource but some of them are closed during the transaciton processing (when a number of threads are running). Could anyone give me advise or suggestion?

I am using WSAD v5.1.2 and DB2 v7.2.3 (Windows version). I am not sure this problme is still occurred when deploying the EJB application to WAS v5.1.

Thanks.
Ricky