• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Accessing the DAO layer without http requests

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written scriplet to get the recent topics in JForum to show on the index page. I added the method getForumForApps(t.getForumId()) and I was successful in getting the recent topics, however there are some problems with the database connection. the index page works only after accessing some link of JForum, also after some time the database connection is lost I suppose. What will be the correct way to do what I am trying.



[originally posted on jforum.net by judekm]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, I'm assuming that this code is running in the same web app as jForum and not a different one..

If so, the problem with the initial call to a Jforum page may be because the CacheEngine and database engine are initialized in the JForum Servlet init method. This servlet processes all *.page requests.

If I remember correctly, the J2EE Specs are kind of vague on when application engines are required to call the init method. There is a load-on-startup web.xml parameter but this may not be honored or the container may be letting requests come through before everything is initialized. Or worse, not calling the init method until the first call to the jForum servlet is made.

The DB problem (and maybe the init problem) may be due to the fact that the JForum servlet service method does a check to see if the DB is initialized and re-initializes it if it isn't. I'm not sure, but I guess that code is being called every time to fix similar problems.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You for the response.
If so how can I initialize the cache engine and database engine from the scriplet.
[originally posted on jforum.net by judekm]
 
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic