Hi,

> I am not clear what credentials you are refering to

I refer to the database user name and password that are currently
stored in the repository.xml (except when using JNDI):

http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html
# <param name="user" value=""/>
# <param name="password" value=""/>

> and how current
> jackrabbit works with backend login

Currently, Jackrabbit requires to be able to create a database
connection when initializing.

> If it's related to storage backend, it need always store on repository level.

It depends on what you mean with "repository level". It doesn't make
sense to store the user name and password of the database inside the
database (I hope you agree :-)

I would like to make repository.xml optional. To do that, the user
name and password for the database need to be stored somewhere else.
One solution is to provide them when creating the repository object.
Example:

String factoryClass = "...";
String url = "...?user=sa&password=xyz";
RepositoryFactory factory = (RepositoryFactory)
Class.forName(factoryClass).newInstance();
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("url", url);
Repository rep = factory.getRepository(parameters);

In this case the user name and password are included in the repository
URL. This solution is almost what we have how (except there is no
repository.xml).

What I propose is: Jackrabbit should support the following use case as well:

String factoryClass = "...";
String url = "...";
RepositoryFactory factory = (RepositoryFactory)
Class.forName(factoryClass).newInstance();
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("url", url);
Repository rep = factory.getRepository(parameters);
Session session = rep.login(new SimpleCredentials("sa", "xyz".toCharArray()));

Here, the user name and password of the storage backend (for example a
relational database) are not included in the repository URL. Instead,
they are supplied in the first session that logs into the repository.
Currently this use case is not supported. I suggest that Jackrabbit 3
support this as a possible use case (not necessarily as the default
use case).

> Unless we designed to map jcr session user to jdbc user.

Not necessarily. The "Delayed Repository Initialization" is not
related to how Jackrabbit works internally. Jackrabbit might still use
only one JDBC connection for the whole repository. Or it might use a
JDBC connection pool. Or it might use one JDBC connection per session.

Regards,
Thomas

Reply via email to