You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Justin Schoeman <ju...@expertron.co.za> on 2006/02/20 18:13:13 UTC

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?

Posted by robert <ro...@gmail.com>.
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

-- 

Re: Storing objects?

Posted by Justin Schoeman <ju...@expertron.co.za>.
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?

Posted by Thomas Burdairon <tb...@entelience.com>.
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?

Posted by Justin Schoeman <ju...@expertron.co.za>.
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
> 
> 

Re: Storing objects?

Posted by Thomas Burdairon <tb...@entelience.com>.
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