Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- EntityManager.flush

- EntityManager.flush

2007-07-12       - By DaHunter

 Back
Hi,

I have created an EJB 3.0 application that consists of EJBs and JSP pages.  I
have a problem where a call to EntityManager.flush in a stateless session bean
seems to be ignored.  Here is what is happening:

A timer kicks off a stateless session been every X minutes.  This bean does
some work, sends an HTTP POST to another server and then logs an entry in an
Oracle database that records that it sent the POST.  This is done in a loop
that could run 10 times, or hundreds of times.  So every iteration of the loop
makes an HTTP POST and creates 1 database record.  After the end of each
iteration I am calling flush to (try) and force the record to be written out to
Oracle, and not just stored in JBoss? cache.

While the above loop is running, the server I sent the HTTP POST to in the loop
above starts connecting to a JSP page I have created to say that it completed
the work I sent it.  The JSP page uses another stateless session bean, which
looks up the database record created in the loop by its primary key and
attempts to update it.  The problem I am having occurs here.  If the method
with the loop above is still running, the database record is not found.  

So JBoss is not storing the record in Oracle until the method completes, even
though I am calling flush.  And since my lookup for the record is based on its
primary key, JBoss doesn?t check its cache but goes directly to the database
(according to the docs I read anyway).

I am using JBoss 4.0.4.  Does anyone have any tips or ideas as to how I can
overcome this?  Thanks!

DaHunter


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4063504#4063504

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4063504
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.