persistence@glassfish.java.net

Re: Duplicate Column?

From: Dennis Gesker <dennis_at_gesker.com>
Date: Tue, 22 Apr 2008 13:06:02 -0600

I posted this question to the users_at_glassfish.dev.java.net mailing list but
didn't get a response. In the mean time I swapped out the microsoft jdbc
driver for the jTDS jdbc driver. Still the problem remains.

Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs
(04/11/2008))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Column name 'EmployeeID' appears
more than once in the result column list.
Error Code: 264


Any chance of a pointer in the right direction?


 --drg


On Fri, Apr 18, 2008 at 5:00 PM, Dennis Gesker <dennis_at_gesker.com> wrote:

> 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
>
>


-- 
Dennis R. Gesker
email: dennis_at_gesker.com
Key Id: 0xEFA10A51
First things first, but not necessarily in that order. -- Unknown