users@glassfish.java.net

Duplicate Column?

From: Dennis Gesker <dennis_at_gesker.com>
Date: Fri, 18 Apr 2008 17:00:23 -0600

I am trying to use an em to insert data into a database table but seem to
have hit a snag.

The table was created in the database by JPA from the Entity Class by
setting the toplink.ddl-generation property to 'create-tables' in the
persistence unit.

The field that is being reported as "appearing more than once" only appears
once in the Entity class and does have both a getter and setter method -- no
compile error. A query against the syscolums table in the database server
indicates that the field only appears once. A 'select *' against the table
at the database server also only returns this column once.The user/passwd
combination used in the connection pool has full privilages on the database.

There are quite a few fields in the table but all are of basic types;
string, float, etc. - no blobs; The table is meant to be updated each
evening from a the results of a query on a different database server so
presently I'm pulling the data (using JPA) into a resultlist and attempting
to use an iterator/while loop to persist the records. The loop doesn't
appear to be the issue.

The specific error I'm getting is:

Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-4002]
(Oracle TopLink Essentials - 2.0.1 (Build b03-fcs (04/05/2008))):
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Column
name 'EmployeeID' appears more than once in the result column list.

The 'Call" portion of the error message includes the column as part of the
INSERT INTO twice. Other columns are also listed twice in this statement.


Could someone offer a pointer on where I might look next to resolve this
item? Any tips or hints would be most appreciated.

Dennis
Using NB6.1, Glassfish V2Ur2