| Author |
Need Suggestion ? JDBC Connection
|
ram kumar
Ranch Hand
Joined: May 22, 2008
Posts: 146
|
|
I have two classes, #1 . One for logging #2 . One for reading configuration Logging and the reading configuration are all done at the oracle. To perform these operation at oracle, both classes need to get a connection to oracle. Right ? Shall i create a single connection object to do this ? 'means' can Connection con = one connection for both the OPerations (loging and reading configuration) It is in a threaded environment. Logging and reading configuration extends thread and runs as thread. Do i have to create seperate connections to oracle for each thing or i can use one for both ? Its a DAO Pattern code , and its too heavy if i post right now. Could some one give me a suggestion on this scenario !
|
Discussion - the powerfull way to excellence!
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
Are you using any connection pooling ? Thanks, Shailesh
|
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
|
 |
ram kumar
Ranch Hand
Joined: May 22, 2008
Posts: 146
|
|
Originally posted by Shailesh Chandra: Are you using any connection pooling ? Thanks, Shailesh
No, am not pooling the connection.
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
ok,I would suggest keep separate connection for both. I guess reading configuration is one time process.You will reuse value read in configuration. you can cache the configuration in Maps, refresh the Map on regular interval in your threads. For logging you can use separate connection, also try to go for some connection pooling. Thanks, Shailesh
|
 |
 |
|
|
subject: Need Suggestion ? JDBC Connection
|
|
|