Hi Castor gurus,

I am new to castor and am trying to use it on a fairly large project.
I am concerned about the overhead of jdo.getDatabase().  To me 
it appears that when you request for a database it loads up the mapping.
Which I think is a heavy job, specially when the mapping gets large.
In my case it will get large.  Please tell me it isn't so.  

regards,
Dinesh
At Friday, 31 January 2003, you wrote:

>try searching the mailing list for: "best practices and samples 
for servlet 
>environment/application server (jboss) environment".
>
>basically, each call to the db, a servlet call would need to obtain 
a new 
>db connection via jdo.getDatabase().  [sharing connections wouldn't 
work, 
>since it is possible that a db operation by a single servlet request 
might 
>need to rollback the operations attempted on the connection.]  although 

>getting a new connection for each servlet request seems like a lot of 
>overhead, using the container's jndi lookup should improve performance,
as 
>many containers or jdbc drivers (from what i've read) provide connection 

>pooling.  also castor does have a cache, so if an object is in the 
cache, 
>it won't call the db, depending on the castor cache-type setting.
>
>i'm still learning castor myself, so hopefully the castor veterans 
will 
>also share their insights.
>
>At 10:14 03/01/31 -0500, you wrote:
>>Hiya,
>>
>>I hadn't considered thread-safety, so I'm very glad this came up.
Are you
>>(collectively) saying that there is a potential problem with the 
following
>>scenario?
>>
>>- multiple users in a servlet application
>>- each referencing their own xml document (no concurrent access 
to the same
>>document)
>>- each frequently reading from and writing to their document in 
a native XML
>>DB
>>- The Castor value objects for each client stored in HttpSession
>>
>>If so, then you're saying we need to throttle the servlet to one 
operation
>>at a time?
>>
>>(Please tell me that isn't so)
>>
>> > -----Original Message-----
>> > From: Conor Allen [SMTP:[EMAIL PROTECTED]]
>> > Sent: Friday, January 31, 2003 9:55 AM
>> > To:   [EMAIL PROTECTED]
>> > Subject:      Re: [castor-dev] Using Castor safely in Servlets
>> >
>> > You can synchronize on the servlet itself or make the servlet 
single
>> > threaded.
>> >
>> > Conor
>> >
>> > -----Original Message-----
>> > From: Robert Kent [mailto:[EMAIL PROTECTED]]
>> > Sent: 31 January 2003 14:17
>> > To: [EMAIL PROTECTED]
>> > Subject: [castor-dev] Using Castor safely in Servlets
>> >
>> > Hi -
>> >
>> > I was able to get rid of some of my more frustrating problems 
when I
>> > realized that I was trying to use Castor in the wrong situation 
(eg,
>> > JSPs
>> > instead of Servlets).  However, I recall from the Castor website 
that
>> > the
>> > libraries are not thread safe.  Servlet code must be.
>> >
>> > My question: how can I use Castor in a threadsafe way?  Is there an
>> > appropriate variable or variables I can synchronize on?  Would 
it be the
>> > JDO
>> > object?  The Database?  The individual mapped objects?
>> >
>> > One example of what I must do is fetch an object from the database 
via
>> > an
>> > OQL query, change one or more fields, and then commit() the 
changes.
>> > Where
>> > should I use synchronize to make this threadsafe?
>> >
>> > Any pointers to more detailed docs about Castor and threading 
would be
>> > greatly appreciated.
>> >
>> >
>> > Thanks,
>> > _________________________________
>> >
>> >  Robert Kent  -  (617) 413-3510
>> >      http://www.rjk-comm.com/
>> > _________________________________
>> >
>> > -----------------------------------------------------------
>> > If you wish to unsubscribe from this mailing, send mail to
>> > [EMAIL PROTECTED] with a subject of:
>> >       unsubscribe castor-dev
>> >
>> >
>> >
>> > --
>> >
>> > This e-mail is confidential and is intended for the named recipient 
only.
>> > If
>> > you receive it in error please destroy the message and all copies.
Kainos
>> > Software Ltd. does not accept liability for damage sustained 
as a result
>> > of
>> > malicious software (e.g. viruses). Kainos does not accept liability 
for,
>> > or
>> > permit, the creation of contracts on its behalf by e-mail, the 
publication
>> > of
>> > any defamatory statement by its employees by e-mail, or changes
>> > subsequently
>> > made to the original message. The Company's registered office 
is located
>> > at
>> > 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland, Tel 
+44 28 9057
>> > 1100.
>> >
>> > -----------------------------------------------------------
>> > If you wish to unsubscribe from this mailing, send mail to
>> > [EMAIL PROTECTED] with a subject of:
>> >       unsubscribe castor-dev
>> >
>>
>>---------------------------------------------------------------
---------------
>>CONFIDENTIALITY NOTICE: If you have received this e-mail in error,
please 
>>immediately notify the sender by e-mail at the address shown.  
This e-mail 
>>transmission may contain confidential information.  This information 
is 
>>intended only for the use of the individual(s) or entity to whom 
it is 
>>intended even if addressed incorrectly.  Please delete it from 
your files 
>>if you are not the intended recipient.  Thank you for your compliance.

>>Copyright (c) 2003 CIGNA
>>
>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>>-----------------------------------------------------------
>>If you wish to unsubscribe from this mailing, send mail to
>>[EMAIL PROTECTED] with a subject of:
>>         unsubscribe castor-dev
>
>----------------------------------------------------------- 
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
>



Dinesh
Cell:703-725-4153
Email:[EMAIL PROTECTED]
Web Site:http://www.trailblazingsolutions.com/dinesh

The significant problems we face cannot be solved by the same level 
of thinking that created them  - Albert Einstein

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to