[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing Ozone from a servlet

On Mon, 17 Jan 2000, Eric van der Vlist wrote:
> Hi,
> I am still wondering if the architecture I am currently using couldn't
> be optimized :
> HTML browser
>    | ^
>    V |
> Apache web server
>    | ^
>    V |
> Jserv servlet
>    | ^
>    V |
> ozone OODBMS
> All being done through sockets (I've seen in previous posts that they
> could be a bottleneck) by different OS processes...
> I need to keep the apache web server (highly scalable and configurable
> and I won't switch all the sites on my server at the same time).
> I don't see how I can do without the servlet... thus my question :
> Isn't it a way to run ozone and jserv in the same VM ?
> I have seen that you've got remote and local databases classes.
Yes, LocalDatabase is the way to use ozone "embedded" in the client VM. This
should also work with servlets and jserv.

But in most cases the real bottleneck is the serialization of the method
arguments - not the socket communication. Of course, we can pass arguments of a
local method call by reference but this may lead to very ugly bugs if you try
to use the same code for local and remote connections. So we decided to copy
also arguments of local calls.

> If I was using a local database in a servlet, would if be run in a
> separate thread and be accessible by different servlet threads handling
> different requests ?
No. A LocalDatabase can be accessed by different threads but one database
connection (RemoteDatabase or LocalDatabase) cannot handle nested requests.
(methods on LocalDatabase are synchronized). If you have a RemoteDatabase, then
you can use one connection for each thread. With LocalDatabase you have to use
one connection for all threads. This means a thread trying to access the
database can be blocked by another thread.

Falko Braeutigam                         mailto:falko@softwarebuero.de
softwarebuero m&b (SMB)                    http://www.softwarebuero.de