Thursday 15 January 2015

jackrabbit start repository slow -


In my existing Tomcat project, I integrate JackBrbit. Its functionality works well though, the start of the repository is very slow It takes about 5 seconds I think it is not tolerant. Does anyone have some ideas about how to integrate Jacobbet into a web project?

Currently, I have a factory session in my web project. The code is as follows:

  Public class TMPSessionFactory {Public Stable session getSession () throws repository expansion, naming upstation {String configFile = "C: \\ workspaces \\ repository.xml"; String repHomeDir = "C: \\ JackRabbitDemo \\ repository"; Hashtable & lt; String, Object & gt; Hashtable = new hashtable & lt; String, Object & gt; (); Hash tabel (reference. INITIAL_CONTEXT_FACTORY, DummyInitialContextFactory.class.getName ()); Hashtable.pt (context.providER_URL, "127.0.0.1"); Initial Content CTX = New Initial Concert (HashTable); RegistryHelper.registerRepository (ctx, "repo", configfile, repHomeDir, true); Repository R = (repository) ctx.lookup ("repo"); Simple credentials cred = New Simple Credentials ("Admin", "Administrator". ToCharArray ()); Session session = R. Login (credit, empty); Return Session;}}   

Every time I need a JackBebbit session, I will call this static job.

I do not know if my path is fair or because it works but not enough (every time, the start of the repository is slow).

Do you mean that you create a new repository and every time you access your repository Want to tie JNDI before? All this code:

  string configfile = "C: \\ workspace \\ repository.xml"; String repHomeDir = "C: \\ JackRabbitDemo \\ repository"; Hashtable & lt; String, Object & gt; Hashtable = new hashtable & lt; String, Object & gt; (); Hash tabel (reference. INITIAL_CONTEXT_FACTORY, DummyInitialContextFactory.class.getName ()); Hashtable.pt (context.providER_URL, "127.0.0.1"); Initial Content CTX = New Initial Concert (HashTable); RegistryHelper.registerRepository (ctx, "repo", configfile, repHomeDir, true);   

should be said only once. Perhaps you should declare your JackBeb store as a tomcat resource because it has been documented here:

No comments:

Post a Comment