JBoss-2.4.1_Tomcat-3.2.3:

I have a relatively simple EJB/web application.  I have a list page, and an
edit page.  Currently, my primary key is not opaque, and I can currently change
it in the application.  Is this a big mistake?  I could use some detail on why
that might be.

I'm seeing an odd symptom when I change the primary key the SECOND time.

I start the application, which displays a "list page".  I click "Edit" on a row
to go to an "edit page", and I change one character in the primary key field
and click "Save".  This causes the list of objects to be retrieved again and
the "list page" to be redisplayed.  So far, this works correctly.  The
redisplay of the list page shows the new value.

I verified that the database has changed correctly by running a query in a
"mysql" window.

Now, I click "Edit" again and change the primary key value back to the original
and click "Save".  The list page redisplays, but with the wrong value.  If the
original value was "A", and the second value was "B", the list now displays "B"
instead of the correct value of "A".

I again verified that the database has changed correctly by running a query in
a "mysql" window.  At this point, the database has the value "A", but the value
of the attribute in the Bean instance was "B".

I put print statements into my bean class, both in the "set" method for this
attribute and the method which creates and returns the "value object", which is
an aggregation of all the fields.

In the case that fails, I see it correctly "set" the new value, but right after
that, when I see it building the value object, the primary key is the wrong
value.  It's as if those two last print statements are being executed in
different instances.

Could this all be because of my not using an opaque primary key, and changing
it?  I was planning on reviewing the patterns for generating unique opaque OID
values for primary keys, but I'd like to know for sure whether this is the
issue here.

-- 
===================================================================
David M. Karr          ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to