Exception inserting into Sybase AsE TEXT field

View: New views
3 Messages — Rating Filter:   Alert me  

Exception inserting into Sybase AsE TEXT field

by cmathrusse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

EclipseLink version:  1.1.1
Sybase ASE 15.
Table is defined as follows:

CREATE TABLE DOCSTORE (ID NUMERIC(19) IDENTITY NOT NULL, CONTENT TEXT NULL, MOD_DATE DATETIME NOT NULL, CREATE_DATE DATETIME NOT NULL, VERSION INTEGER NOT NULL, PRIMARY KEY (ID));

Entity is defined as follows:

public class DocStore implements Serializable {
  private static final long serialVersionUID = 5064345696140435452L;

  @Id @GeneratedValue( strategy = GenerationType.IDENTITY )
  @Column(
        name       = "ID",
        nullable   = false,
        updatable  = false
  )    
  private Long id;

  @Lob
  @Column( name="CONTENT", nullable = true )
  private String content;

  @Column( name = "CREATE_DATE", nullable = false )
  @Temporal( javax.persistence.TemporalType.TIMESTAMP )
  private Calendar createDate;
 
  @Column( name = "MOD_DATE", nullable = false )
  @Temporal( javax.persistence.TemporalType.TIMESTAMP )
  private Calendar modDate;
 
  @Column( name = "VERSION", nullable = false )
  @Version
  private int version;
 
I am able to perform inserts successfully into this table consistently. The data being inserted into the CONTENT field is always XML. I am having a consistent problem inserting into this table, each night, when I attempt to insert a document that is approx. 650 lines of formatted XML. I've tried the insert using DB Visualizer, using the generated INSERT statement and it succeeds, so I don't know why it is not working each night when EclipseLink attempts the insert.

The Exception message is as follows:
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Procedure *ss1168273573_2036800886ss* expects parameter @p0, which was not supplied.

        at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
        at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:758)

I have no idea why a store proc is being invoked as my database has none.
Any help is greatly appreciated.

Thanks....

Re: Exception inserting into Sybase AsE TEXT field

by cmathrusse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How does EclipseLink perform inserts into CLOB fields? If the current implementation is simply performing a setString(param) then truncation will occur with the ASE JConnect driver.

I know when I was using iBatis with ASE I had to write a custom type handler to ensure that the data was streamed into the database. Is there any way that I can provide EclipseLink with a custom type handler to perform the insert/update in the same manner?

Re: Exception inserting into Sybase AsE TEXT field

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can use a SessionCustomizer to enable stream binding,

session.getLogin().setUsesStreamsForBinding(true);

cmathrusse wrote:
How does EclipseLink perform inserts into CLOB fields? If the current implementation is simply performing a setString(param) then truncation will occur with the ASE JConnect driver.

I know when I was using iBatis with ASE I had to write a custom type handler to ensure that the data was streamed into the database. Is there any way that I can provide EclipseLink with a custom type handler to perform the insert/update in the same manner?