Issue Type: Bug Bug
Affects Versions: 3.6.10
Assignee: Unassigned
Components: core
Created: 19/Feb/13 1:01 PM
Description:

Issue
======
When Hibernate tries to insert the children (ErrorDetails) a "Parameter index is out of range" results.
Logs show the following:

Caused by: com.ibm.db2.jcc.b.co: [jcc][10145][10844][3.53.70] Invalid parameter 8: Parameter index is out of range. ERRORCODE=-4461, SQLSTATE=42815

ErrLog
*/ insert
into
ERR_LOG
(ERR_CD, ERR_MSG, FILE_ITEM_NR, UPLOAD_TYPE_CD, SUBTYP, EXEC_ID, LN_NR)
values
(?, ?, ?, ?, ?, ?, ?)
binding parameter [1] as [INTEGER] - 8
binding parameter [2] as [VARCHAR] - There was an error:Unable to create entityBean for update because the profileNbr can not be determined. The loginID= and the profileID=19971.

binding parameter [3] as [VARCHAR] - 3
binding parameter [4] as [VARCHAR] - PAB
binding parameter [5] as [VARCHAR] -
binding parameter [6] as [INTEGER] - 100000
binding parameter [7] as [VARCHAR] - PAB
binding parameter [8] as [VARCHAR] -

Binding parameters 4 and 5 are repeated again in 7 & 8. Additionaly, there is no binding parameter for LN_NR. Its as if binding parameters 7 & 8 took the place of LN_NR binding parameter.

I can't change the tables for this. Any suggestions how to get around this problem?

Error (Parent)
===============

@Id
@GenericGenerator(name="errorGenerator", strategy="increment")
@GeneratedValue(generator="errorGenerator")
@Column(name="EXEC_ID", nullable=false)
public int getExecId() { return this.execId; }
public void setExecId(int execId)

{ this.execId = execId; }

@Id
@Column(name="UPLOAD_TYPE_CD", nullable=false, length=3)
public String getUploadTypeCd() { return this.uploadTypeCd; }
public void setUploadTypeCd(String uploadTypeCd) { this.uploadTypeCd = uploadTypeCd; }

@Id
@Column(name="SUBTYP", nullable=false, length=6)
public String getSubtyp() { return this.subtyp; }

public void setSubtyp(String subtyp) { this.subtyp = subtyp; }

@OneToMany
@JoinColumns( { @JoinColumn(name="EXEC_ID", referencedColumnName="EXEC_ID", nullable=false), @JoinColumn(name="SUBTYP", referencedColumnName="SUBTYP", nullable=false), @JoinColumn(name="UPLOAD_TYPE_CD", referencedColumnName="UPLOAD_TYPE_CD", nullable=false) } )
@Cascade({CascadeType.ALL})
public Set<ErrLog> getErrLogs() { return this.errLogs; }

public void setErrLogs(Set<ErrLog> errLogs) { this.errLogs = errLogs; }

ErrorDetails (Children)
========================
@Id
@Column(name="LN_NR", nullable=false)
public int getLnNr() { return this.lnNr; //PART OF THE PK FOR THIS TABLE. THIS IS NOT AN INDEX. IT IS THE LINE IN A FILE THAT CAUSED THE ERROR. }

@Id
@ManyToOne
@JoinColumns( { @JoinColumn(name="EXEC_ID", referencedColumnName="EXEC_ID", nullable=false, insertable=false, updatable=false), @JoinColumn(name="SUBTYP", referencedColumnName="SUBTYP", nullable=false, insertable=false, updatable=false), @JoinColumn(name="UPLOAD_TYPE_CD", referencedColumnName="UPLOAD_TYPE_CD", nullable=false, insertable=false, updatable=false) } )
public Exec getExec() { return this.exec; }

public void setExec(Exec exec) { this.exec = exec; }

Environment: Hibernate 3.6.10, DB2, Websphere 7.
Project: Hibernate ORM
Labels: hibernate
Priority: Major Major
Reporter: Eric Anderson
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira