Hi Damon. I'm no expert on JBoss or EJB, but the symptoms you report sound
to me like an uncommitted transaction. Another user or another session
can't see uncommitted changes. The same database session (connection) that
creates the bean can find it by findByPrimaryKey even though it has not been
committed. That's normal behavior. Perhaps that database connection
remains open while the bean is active, so clients using the bean can access
its data fine, but when you kill JBoss the transaction gets rolled back and
no data gets written into Postgres. Some databases roll back by default
when a connection is killed, others commit by default when a connection is
killed. You could define "public void ejbStore()" to output something to a
log file so you can see if the bean ever gets synchronized with the
database. See
http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Transaction2.html#
10490
for info on container managed transactions.
Damon wrote:
Here's the story:
CMP Entity beans deploy fine, PostgreSQL connection pool connects fine,
Session beans deploy fine. All works fine EXCEPT!!!
My bean clients can successfully create, make remote calls to, and modify.
excellent. NO EXCEPTIONS!
HERE'S THE PROBLEM!!!!
NOTHING IS STORED IN THE DATABASE!
So, thinking I am just losing my mind, I run the client a second time, this
time doing findByPrimaryKeys on the entity beans. THEY ALL FIND FINE!!!
So, I run over to psql and connect to the database, NOTHING THERE! SAME
DATABASE NAME, SAME USER, SAME PASSWORD, NO DATA! DataSources are correct
as far as I can tell, straight outta the manual. I know it is the right
database 'cause it is the only machine, only one postmaster running, and
only one user with one database and it matches EXACTLY in the jboss.jcml. I
even have the '-i' option on in the postmaster startup scripts.
Hmmm.... I do a kill jboss. Check the database... nothing there... Startup
jboss, run the findByPrimaryKey again... NO BEAN! do a create()... creates
fine...check pgsql NO DATA! ... do a findByPrimaryKey()... FINDS THE BEAN I
CREATED EVEN THOUGH NO DATA EXISTS IN THE DATABASE! So, I extract all the
data from the bean to make sure it is correct... yep, everything is there,
just like I coded. I wonder how it could get there without being persisted
(yes, my ejb-jar.xml is correct, all cmp fields are there). I would think
an exception should be thrown somewhere along the line if I create a bean
and it isn't stored in the database when it should be.
Stared at the problem for seven hours straight... blew away entire JBoss
installation and started from scratch... twice... same problem. Nothing in
documentation or mail archives suggesting how to actually store data into
the database when it isn't working "in the real world."
Ok, can someone please tell me which <magic-freakin-xml-element>turns on
ACTUAL DATABASE WRITES AND NOT JUST A TEASE!</magic-freakin-xml-element>
There HAS TO BE something I am missing.
I'll buy the first person who answers this correctly a pizza. I'm not
kidding.
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user