Archanaa Panda

+ Follow
since Dec 10, 2004
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 Archanaa Panda


I am currently in the architecture analysis and design phase for a project which may very likely involve pure socket, thread and JDBC programming.

In this project, thousands of client devices may periodically send measurement data that has to be stored into a database system. The communication with the client devices would be over TCP/IP sockets.

These sockets would probably be long-lived because the server may have to collect information from the client devices in particular scenarios.

This data has to be decompressed/transformed into a format for storing into the database.

As bulk amounts of data are expected, this solution has to be highly performant and scalable.

I have a few questions here-
1. For each socket opened between the client and server, would it be advisable to dedicate a thread for reading the socket? Is there any limit to the threads and sockets that can be kept open on the server? If yes, it would probably be better to reuse the threads across various open sockets. How long can these sockets be kept alive?

2. Each request's data has to be processed (probably transformed) and inserted into database tables. Is it better to acquire a connection from a connection pool for each thread and insert the data into the database table or would a better architecture be to dedicate a thread for batch insertion of database tables over a single connection and make the receiver threads store data in a queue wherefrom this data would be picked up by this thread and inserted into the database in bulk. Again, how many threads for database interaction are recommended.

3. If I need to test this out, what would be the right approach/tools to use?

Thanks and Regards,
16 years ago

I currently have to design for a requirement as follows-
1. Send report data to a middleware server from a client.
2. Middleware server formats the report data and creates PDF/RTF/plain text documents.
3. Documents need to be sent via Mail or Fax to the desired destination.

The process of creating PDF or RTF document seems pretty clear - I could use FOP or similar open source APIs for the same.

However, I have a design issue here-
There can be two ways of sending the PDF document as attachment.
a) Temporarily write the PDF document to a temporary .pdf file in the middleware server and then send the attachment using FileDataSource and DataHandler.
b) Use ByteArrayOutputStream to write the PDF document as a byte[] array in the middleware server and then send the attachment using DataHandler directly.

What are the pros and cons of each approach and which would be the preferred solution? Personally I would prefer solution 2 since there might issues in doing file I/O from EJBs, for example. Please remember that the PDF/ RTF document creation takes place in the middleware server itself. The client does not upload these documents to the server.

17 years ago

Is it possible to programmatically undeploy an ear by using EARDeployer or any other means?

We have a strange requirement in our project as follows-

"We have an EAR file, there has an InitServlet which check some external
resources ( like SMS server blah blah ) whether they are available or not
while starting the server.

Now I want an application which won't allow application server to deploy the
whole EAR file if some external entities are missing. Also if the
application is running ( deployed ) and in-between the same external
entities becomes unavailable then it should undeploy the whole EAR file and
whenever any user try to access the application ( at this time when the
application is undeployed ) s/he should get a message that xxx application
is unavailable because of XXX problem."
17 years ago