Mike - 

Since this is a generated file in a deployment directory shouldn't it always
be overwritten if there is a change in one of the package deployment
descriptors?  The only reason it would be a pain in the ass is if you
changed the generated file to suit your needs and did not change the one you
bundle with your package.

If this is intended behavior, IMHO it is significantly less intuitive.  Its
kind of like saying a class should only be recompiled if you delete the
class before recompiling, where one would expect that changing the source
would be enough.

Just my two cents.

Aaron Tavistock

-----Original Message-----
From: Mike Cannon-Brookes [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 21, 2001 2:13 AM
To: Orion-Interest
Subject: Re: CMP Entity Bean Craziness


You're not special at all (well you may be - but that's a different
story ;)) - what you describe is exactly the intended behaviour of the
server.

You're editing the deployment files in your EAR which are only used _IF
AND ONLY IF_ there is no existing deployment file. Otherwise the
existing deployment file is used, and the one in the EAR ignored. 

This behaviour is as it should be because otherwise you'd end up
overwriting your deployment settings all the time which would be a royal
pain in the ass.

HOWEVER to do what you want, simply delete the deployment directory and
your edited files will be copied and used. You will see a message on the
console telling you that the deployment file has been copied.

Hope this helps clear things up.

Cheers,
Mike

-- 
Mike Cannon-Brookes :: [EMAIL PROTECTED]

Atlassian :: http://www.atlassian.com
     Supporting YOUR J2EE World


On Fri, 2001-12-21 at 15:01, Ed Brown wrote:
> 
> 
> Okay, here is the situation.
> 
> Database: Oracle on Solaris
> Orion server: 1.5.2 on Windows 2000
> Operating System: Windows 2000
> 
> I have a database table named FOO. I want to create different entity beans
to
> provide different views of the table named FOO. FOO is a table with many
> columns. (Sure, I could create one entity bean, and then create "wrapper"
> classes that provides the views of table FOO that I want, but I didn't
want
> to do that). Many of those column names contain underscores.
> 
> When I created the first CMP entity bean, I mapped all column names and
used the
> 
> table name as the entity bean name. I wrote the appropriate ejb-jar.xml
and
> orion-ejb-jar.xml and packaged them. In the orion-ejb-jar.xml file, I used
the
> "persistence-name" to map the Java attribute to the proper table column.
For all
> 
> attributes that mapped to a column name with an underscore, I removed the
> underscore and uppercased the next character. (A column named
long_col_name
> would map to the attribute longColName).
> 
> So I deployed the entity bean and there were deployment errors. Orion
complained
> 
> about illegal column names. Much later after going around in circles, I
looked
> at the ejb-jar.xml file that Orion generated and I noticed that the values
for
> the persistence-name mapped exactly to the column names of the database
table.
> It *IGNORED* what I had placed there. I had to edit the deployed xml file
to get
> 
> the mapping correct and properly deployed.
> 
> Now, that's not very nice.
> 
> Next, I created another CMP entity bean to give a different view of table
FOO. I
> 
> used the entity name FooTimeView and used the table attribute of
> entity-deployment in the orion-ejb-jar.xml to map the entity to the FOO
table. I
> 
> deployed it and, again, I got errors. I had to edit the deployed xml file
to get
> 
> the correct mappings. I deployed again and it still failed. Only this
time, it
> tried to create a table named FOOTIMEVIEW. (Actually, it *DID* create the
> table). That's not what I expected to happen. So, I looked at the deployed
xml
> file again and I noticed that the table name had been changed from what I
> specified. This time, I also looked at the query that was generated and
noticed
> 
> that the column names with underscores had the underscores removed.
> 
> Now, that's not very nice.
> 
> I edited that and restarted the server. Now all is well.
> 
> Okay, now I *KNOW* what I described should not happen. I want to know why
it
> did happen.
> 
> Has this happened to anyone else, or am I "special"?
> 
> 
> Ed Brown
> 
> 
> _________________________________________________________________________
> This mail sent via toadmail.com, web e-mail @ ToadNet - want to go fast?
> http://www.toadmail.com
> 
-- 
Cheers,
Mike

-- 
Mike Cannon-Brookes :: [EMAIL PROTECTED]

Atlassian :: http://www.atlassian.com
     Supporting YOUR J2EE World



Reply via email to