• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jess Threads and the J2EE

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Today a friend mentioned that using Jess within the J2EE was tough to do because Jess spawns a number of threads, which is not allowed (outside of a servlet context object). Dunno, something doesn't pass the smell test.

Can anyone suggest other ways of implementing Jess within the J2EE? If there's a specific strategy to overcome the "J2EE dont allow any thread spawning anyway" issue, I'd appreciate it.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your friend is wrong. Jess spawns no threads.
 
Mike Van
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ernest Friedman-Hill:
Your friend is wrong. Jess spawns no threads.



That's what I thought, and the fact that you brought it up instead of me illustrates a point I like all of my teams to stray away from: the evolutionary conjecture approach to software development. In this approach, software developers who should know better spend hours of arguing over how they feel an API works instead of spending 5 minutes to find out how is actually does work. In this case, effort was lost because someone made the statement that Jess spawns threads, and that statement wasn't challenged.

To reward you for being such a great guy, I've purchased your book. It now sits between my "Core J2EE Patterns" and "Patterns of Enterprise Architecture Books". Now, how do I get it autographed? Too bad you don't live in Maryland!
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a lot of complicated multithreading discussion on the jess-users mailing list because Jess is often used in multithreaded environments; being relatively complex and stateful, Jess's behavior in the face of multiple threads is constantly being probed in new and interesting ways. This might lead the casual observer to think that Jess itself is the source of the threads, but it's not -- it's the environment. Realize that the EJB spec wants to reserve the right to create threads all to itself, so even though EJBs are forbidden to create threads, EJBs still operate in a densely multithreaded environment.

Regarding the book: first, I hope that it won't retire to the shelf until you've read it! Second, through a bizarre twist of fate, I do actually live in Maryland.
 
Mike Van
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ernest Friedman-Hill:
Realize that the EJB spec wants to reserve the right to create threads all to itself, so even though EJBs are forbidden to create threads, EJBs still operate in a densely multithreaded environment.



The question then becomes, in a J2EE environment, is there a preferred implementation type or J2EE pattern? Currently, we're instanteating a RulesEngine within the ServletContextListenger, which has its own limitations.

Regarding the book: first, I hope that it won't retire to the shelf until you've read it! Second, through a bizarre twist of fate, I do actually live in Maryland.



Read it? We're actually quoting it paragraph and verse. One of our newly ordained "Jess Clergy" is putting chapter 4 to music, to be sung as a hymn at the beginning of every day. We intend to start ritual mortification and flagellation soon in order to help us focus on implementing Jess properly. Some think we've gone too far, but can you really go too far with Jess?

- Friar Mike Van
[ May 18, 2006: Message edited by: Mike Van ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic