Storing objects?
Hi again. I am probably showing my ignorance of Java here, but is there a simple way to store Java objects in an Axis webservice? I have a JDBC object for connecting to the DB, but the overhead is high. I would like to be able to store it between calls to speed up operation. Thanks, Justin
Re: Storing objects?
do you mean a session object ?On Feb 20, 2006, at 6:13 PM, Justin Schoeman wrote:Hi again.I am probably showing my ignorance of Java here, but is there a simple way to store Java objects in an Axis webservice? I have a JDBC object for connecting to the DB, but the overhead is high. I would like to be able to store it between calls to speed up operation.Thanks,Justin Thomas
Re: Storing objects?
then use a connection pool if you want to have a common db object (http://jakarta.apache.org/commons/dbcp/)On Feb 20, 2006, at 6:23 PM, Justin Schoeman wrote:Not session - global to the web service - every query should be able to retrieve a common db object (under a lock).-justinThomas Burdairon wrote: do you mean a session object ?On Feb 20, 2006, at 6:13 PM, Justin Schoeman wrote: Hi again.I am probably showing my ignorance of Java here, but is there a simple way to store Java objects in an Axis webservice? I have a JDBC object for connecting to the DB, but the overhead is high. I would like to be able to store it between calls to speed up operation.Thanks,Justin Thomas Thomas
Re: Storing objects?
Excellent thanks! I should have guessed someone would have already thought of it ;-) . -justin Thomas Burdairon wrote: then use a connection pool if you want to have a common db object (http://jakarta.apache.org/commons/dbcp/) On Feb 20, 2006, at 6:23 PM, Justin Schoeman wrote: Not session - global to the web service - every query should be able to retrieve a common db object (under a lock). -justin Thomas Burdairon wrote: do you mean a session object ? On Feb 20, 2006, at 6:13 PM, Justin Schoeman wrote: Hi again. I am probably showing my ignorance of Java here, but is there a simple way to store Java objects in an Axis webservice? I have a JDBC object for connecting to the DB, but the overhead is high. I would like to be able to store it between calls to speed up operation. Thanks, Justin Thomas Thomas
Re: Storing objects?
We're getting pretty far of topic here, but... 1) Use LDAP to perist java objects that are read more then written. LDAP natively has 'java.schema' that can store any object that implements 'serializable' - such as a hashmap filled with strings. However, you did say 'simple' ;-) . 2) Use a singleton. Just place a map or whatever as class variable. This can be done in 5 minutes by any mid-level java developer. It has the disadvantage, however, of losing your cached values on JVM restart. It also has classloader side affects which can complicate things. 3) Use ehcache or whatever and let it handle the caching. It also has simple file peristance that survives JVM restarts. Requires a day or two to get the handle of it. HTH, Robert http://www.braziloutsource.com/ Em Segunda 20 Fevereiro 2006 14:24, o Thomas Burdairon escreveu: then use a connection pool if you want to have a common db object (http://jakarta.apache.org/commons/dbcp/) On Feb 20, 2006, at 6:23 PM, Justin Schoeman wrote: Not session - global to the web service - every query should be able to retrieve a common db object (under a lock). -justin Thomas Burdairon wrote: do you mean a session object ? On Feb 20, 2006, at 6:13 PM, Justin Schoeman wrote: Hi again. I am probably showing my ignorance of Java here, but is there a simple way to store Java objects in an Axis webservice? I have a JDBC object for connecting to the DB, but the overhead is high. I would like to be able to store it between calls to speed up operation. Thanks, Justin Thomas Thomas --