This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Pushker Chaubey

Ranch Hand
+ Follow
since Dec 06, 2006
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pushker Chaubey

Hi,

Here is the situation.

1) We are using oracle DB. we have a field in one of the table and that is having the type varchar2(500 bytes). please note that it is 500 bytes not characters.

2) From my java code I am using pstmt.setString() to set a value in this field.


- I want to know encoding will be used here to change characters to bytes -- the one configured in DB, Or the one which is default for the JVM. Or if there exists any default encoding setting at jdbc driver level.

- Also please let me know how to figure out default encoding used in this case. Any code snippet which will get me the encoding being used here?


Thanks in advance!
Pushker Chaubey
Thanks for input guys!
Experts,

I wonder how thread pools work. Since a particular thread instance can be given only one runnable target (only once through constructor) and run method runs only once, then how can we reuse same instance to run multiple runnable targets.

Or a pooled thread maintains an infinite loop and runs one runnable target in one iteration....a wild vague thought..

What's the real picture. How does it work?

regards,
Pushker haubey
Hi Friends,

among Hashtable, Synchronized HashMap and ConcurrentHashMap in a threaded environment what will be order of performance and why?

regards,
Pushker Chaubey
12 years ago
Hi Max,

Thanks for a quick reply.


regards,
Pushker chaubey
12 years ago
Hi Experts,

How to create a pool of prototype beans in spring?
Please share the required code snippet/configuration.

Thanks and regards,
Pushker Chaubey
12 years ago
Hi Experts,

I have seen this question asked in an interview.

Why we cannot use a class with static methods (and possibly with private constructor) as replacement for Singleton?

Please share your views.

regards,
Pushker chaubey
12 years ago
Hi Experts,

I am trying to implement connection pooling using ConnectionPoolDatasource in a simple java application. I am following these steps -

1) Create a PoolManager class with method to getConnection(). This class implements ConnectionEventListener
2) Create instance of ConnectionPoolDataSource (actually the implementation class provided by vendor)
3) Use getPooledConnection() calls on connectionpooldatasource to get ready with 10 pooled connections in a List
4) register PoolManager as connectionEventlistener to all these pooled connections
5) on Call to PoolManager.getConnection(), take one readymade pooledConnection from list and call getConnection() to obtain connection handle and return
6) In listener method for connectionClosed() get the event source (which is the corresonding PooledConnection) and add it back to list of available pooled connection

This seems to work. But I am not sure whether this is the right way to implement.
Please guide me on this.

Thanks
Pushker Chaubey
Hi Henry,

Thanks for commenting.
Your book is very good.


regards,
Pushker Chaubey
Hi Experts,

I want to know what are the best practices (principles and guidelines) for designing/programming low latency systems. I want to create a list of such practices as guidelines.

If there are any pointers to any article, blog, paper, any section in any book.... please let me know.
If any body has some previous learnings please contribute.

Thanks in advance!
Pushker Chaubey
Hi,

Thanks for showing interest in this problem. I am not sure about isolation level and code is not available right now, so can't look into.
Please let me know in this situation what should be the isolation level set to for data-source connections and for Entitymanager settings? your inputs please...

Also, please note that we are using container managed transaction here and we have NOT declared any transaction attribute on the method callToStoredProc(). I believe though the method callToStoredProc() executes in the propagated transaction, the updates done using connection object are NOT going to be in the same transaction. Please correct me if I am wrong.

We are using Hibernate's JPA provider. Though we were able to get around the problem by getting access to hibernate session factory and then evicting the entity. But here the use of Hibernate's proprietary API is not being accepted and they want me to use only standard JPA APIs to fix it (In order to have no dependency on underlying JPA provider).

Your input are welcome.

Regards,
Pushker Chaubey
Hi experts,

I am facing a very interesting problem. After updating an entity through EntityManager API, I update the data through a stored proc via a jdbc connection object. both the updates - done by em and stored proc are reflected in database. Then in another call to em.find() is made but that does not reflect the changes done by stored proc.

the code flow looks like the following...

..
..//do some changes in entity
..
em.flush();

callToStoredProc(); // this method invokes stored proc via connection object obtained from datasource and does updates

em.clear();
..


And then from within another session bean I call em.find() which does gives me back the data updated through stored proc.

Please provide solutions to my problem.

Thanks in advance!

regards,
Pushker Chaubey
No. I just have plain html on the client side.

But I still wondering how is it possible to check the file size at client side using any applet code or javascript.

Thanks,
Pushker Chaubey
13 years ago