tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juha Laiho <Juha.La...@iki.fi>
Subject Re: Oracle database calling the web app?
Date Wed, 07 Jan 2009 22:22:24 GMT
Bill Davidson wrote:
> Is it possible to set up a callback like situation so that a trigger in an
> Oracle 10g database can call a method in a currently running webapp
> that's running in Tomcat 6?

Yes, there's UTL_HTTP PL/SQL package available in Oracle, which provides
HTTP client functionality. AQ can also do the job, as others have already
told. See f.ex. http://www.psoug.org/reference/utl_http.html for details.

> My situation is that I want to cache some infrequently changed database
> data in memory but when that data does change in the database, I want
> the web applications, running on multiple servers, to immediately pick
> up the change.

As you say it's "on multiple servers", remember that you'll also need to
send the "update" event to multiple destinations. If it were just
a single server, I think you could've arranged things so that also the
update would arrive via the single server.

However, have you actually measured how much load it would put to various
pieces of your system to not cache this data, but just fetch it from the
DB more or less each time it is needed?

> Right now, one idea I have for this is to have the database trigger
> create a file in a file system that's shared by the database server and
> the application servers and have the web apps check for the existence
> of this file to know whether to update the cache.  It feels ugly and
> means hitting a networked file system a lot but it seems like it should
> work and it seems like it should not be as bad as hitting the database
> constantly for something that doesn't change very often.

DB's are pretty adept at caching frequently used data (and queries and ...),
so I'm not certain whether you're achieving anything by replacing one
cache with another (esp. if handling the whole use case does anyway
require accessing some data from the same database).
-- 
..Juha

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message