Multiple Persevere Applications

0 views
Skip to first unread message

pjs67123

unread,
Aug 21, 2009, 8:48:35 PM8/21/09
to Persevere
What would be the best way to have multiple Persevere applications
(each with its own separate Persevere data store!) running under a
single servlet container? I know that each application would go in a
separate folder within the webapp folder and the Persevere related JAR
files would go in the servlet container common lib folder. The
requirement is that each application must have its own separate store,
but the applications would be mostly the same otherwise (same browser
css/image/js files, and the same server-side JS class files in the WEB-
INF/jslib folders. How could I do this without having to maintain
multiple copies of redundant files in each application? Maybe I'm
thinking about this the wrong way and there is a more straight forward
approach. Perhaps this is more of a servlet question, but I thought
that using Persevere added enough of a twist to justify asking the
question here. Thanks.

pjs67123

unread,
Aug 22, 2009, 9:41:56 PM8/22/09
to Persevere
Another possibility would be to have a single application instance
that could attach to different Persevere datastores based on the
subdomain, or a parameter, or session, or whatever. How would I
approach that?

Kris Zyp

unread,
Aug 25, 2009, 12:09:07 AM8/25/09
to persevere...@googlegroups.com
You might want to take a look at org.persvr.util.JettyStart.java. Line
192-202 is the code that creates the webapp for the Persevere instance
(with the Persevere capability of inheriting static resources from the
base folder). It sounds like you need to have multiple webapps/instances
created (have that code repeat for each instance).

Do you need each instance to access it's own store by the same name, or
do all the instances have access to the same set of table where each
instance will retrieve data from their table by a unique name?

Kris

pjs67123

unread,
Aug 25, 2009, 9:38:06 AM8/25/09
to Persevere
I think I'm heading down the wrong path. I would like to be able to
specify multiple local Persevere stores such that:
http://whatever.com:port/Foo refers to c:\FooPath\data\jsdb
http://whatever.com:port/Bar refers to c:\BarPath\data\jsdb (ideally
anywhere on the file system, but it could also be multiple sub-
directories within WEB-INF\data)

Persevere seems to already support that concept when configuring
multiple "org.persvr.datasource.DatabaseTableDataSource" references,
so I'm guessing that it would be fairly straight forward to have the
same approach apply to Persevere's own native store. Is this already
possible?

-Paul

Kris Zyp

unread,
Aug 26, 2009, 1:12:59 AM8/26/09
to persevere...@googlegroups.com
This certainly does seem to be tantalizing close to possible. The
JavaScriptDB can indeed have multiple instances (this is what does all
the main database storage), and currently the JavaScriptDBSource (the
class which has an instance for each table) is currently just setup to
have a single static reference to the DB for all tables. I would think
we could relatively easily add some parameterization to support
multiples storage paths (per table storage paths).
Kris
Reply all
Reply to author
Forward
0 new messages