Thanks to Mikko Kurki-Suonio I have now solved the problem. Not only should
I wipe the deployed application, it turns out that I needed to alter the
defaultdb.script aswell. Originally it contained the line

CREATE TABLE ADDRESSBOOK_EJB_ADDRESSENTRY(NAME VARCHAR NOT NULL PRIMARY
KEY,ADDRESS VARCHAR,CITY VARCHAR)

so even though I wiped my application in the "application-deployments"
folder Orion kept following this script to create the tables needed to store
my EJBs. I simply changed the line to

CREATE TABLE ADDRESSBOOK_EJB_ADDRESSENTRY(NAME VARCHAR NOT NULL PRIMARY
KEY,ADDRESS VARCHAR,CITY VARCHAR,EMAIL VARCHAR)

Which solved the problem.

Still, I feel that this ought not to be necessary. Does anybody know what
else could have been done? Should I store my EJBs somewhere else than the
"defaultdb.data" in order to avoid problems like this?


R.






Original message:



To test Orion I built the address book application from the "Orion CMP
Primer". Since this went quite well I decided to add a single attribute to
the AddressEntry bean, namely a String attribute called email, containing a
persons e-mail address. Unfortunately I forgot to add the
<cmp-field><field-name>email</field-name></cmp-field> to the ejb-jar.xml, so
when launching Orion it failed. "Nothing to worry about - I'll just shutdown
orion and add the cmp-field, and everything will be fine" - I presumed that
Orion would detect the changes and automatically update the default database
to reflect my changes.

When launching the server again I got the following exception:
========
Caught "com.evermind.server.rmi.OrionRemoteException" while attempting to
find all AddressBook entries.
com.evermind.server.rmi.OrionRemoteException: Database error: Column not
found: EMAIL in statement [select addressbook_ejb_AddressEntry.name,
addressbook_ejb_AddressEntry.address, addressbook_ejb_AddressEntry.city,
addressbook_ejb_AddressEntry.email from addressbook_ejb_AddressEntry];
nested exception is: java.sql.SQLException: Column not found: EMAIL in
statement [select addressbook_ejb_AddressEntry.name,
addressbook_ejb_AddressEntry.address, addressbook_ejb_AddressEntry.city,
addressbook_ejb_AddressEntry.email from addressbook_ejb_AddressEntry]
========
Contradicting my expectations it seems Orion does NOT detect my changes to
ejb-jar.xml. Do I really need to add the new "EMAIL" column to the database
myself (I hope not...) - or is there a way to tell Orion that it needs to
update the database for me.

Thanks
Randahl



Reply via email to