Page 1 of 1

CLOB-Problem: ORA-01461: can bind a LONG value ..

Posted: Tue 24 Jan 2012 10:54
by romanFleischer
Hello,

we got big problems with devartDotConnect V 6.10.111.0 when we try to insert a huge amount of characters into a cLOB-Field.

The Update-Statement inside the dbMonitor is really simple.

Code: Select all

update SIBIS.RED_MITTE
   set AEND_DATUM = :p0, AENDER_ID = :p1, LANGTEXT = :p2, LEITTEXT = :p3, REVIEW = :p4
 where ((AENDER_ID = :p5) and (RED_MITTE_ID = :p6)
The parameter :p2 (LANGTEXT) contains more than 4096 german national characters.
When SaveAllObjects is called, we get the following error:
ORA-01461: can bind a LONG value only for insert into a LONG column

The same effect is caused when i try to update the row by devart database tools inside VisualStudio 2010.

But the table column is defined as Type CLOB. What goes wrong? Do we have to configure something?

Thanks in advice
Roman

Posted: Fri 27 Jan 2012 17:48
by Shalex
Please try using the latest (6.70.293) version of dotConnect for Oracle. If the problem persists with 6.70.293 as well:
1) check the data type of your :p2 parameter in dbMonitor - is it VarChar or CLOB?
2) send us a small test project with the corresponding DDL/DML script to reproduce the issue in our environment.

Still does not work with version 6.80.325

Posted: Wed 28 Mar 2012 08:18
by romanFleischer
Sorry it took some time to get the current version, because of our complex ordering process. But now I have installed the current version 6.80.325, and the error occurs again.

The :p2 parameter in dbMonitor is shown as NVarChar (not as CLOB).
Maybe our mapping is not right?

Our Mapping is in this way:

Code: Select all

modelBuilder.Entity().MapSingleType(entity => new
{
   AEND_DATUM = entity.LastChangeDate,
   AENDER_ID = entity.LastEditor.Id,
   LANGTEXT = entity.Text,
   LEITTEXT = entity.TeaserText,
   REVIEW = entity.Reviewer,
   EDITORIAL_ID = entity.Id
   BILD = entity.HasImage
   TITEL = entity.Title
   .....
 }
 ).ToTable("EDITORIAL");
The class for the news entity has String for the cLob databese field:

Code: Select all

public partial class News
{
	public int Id { get; set;}
	public DateTime ? LastChangeDate { get; set;}
	public virtual ebis.Domain.Sibis.User LastEditor { get; set;}
	public String Text { get; set;}
	public String TeaserText { get; set;}
	public String Reviewer { get;  set;}
	public int ? HasImage { get; set;}
	public String Title { get; set;}
	....
}
an the table is created in this way:

Code: Select all

CREATE TABLE EDITORIAL 
(
   AEND_DATUM DATE,
   AENDER_ID NUMBER(10),
   LANGTEXT CLOB,
   LEITTEXT VARCHAR2(400),
   REVIEW VARCHAR2(30),
   EDITORIAL_ID NUMBER(5),
   BILD NUMBER(1),
   TITEL VARCHAR2(60),
   CONSTRAINT SYS_C0022142 PRIMARY KEY (EDITORIAL_ID),
   CONSTRAINT SYS_C0022155 FOREIGN KEY (AENDER_ID)
     REFERENCES User(DB_USER_ID)
);
what is wrong in our solution?
thanks in advise
Roman

Posted: Fri 30 Mar 2012 16:22
by Shalex
Please specify explicitly the CLOB/NCLOB server data type for your string columns with ColumnAttribute (the TypeName property: http://msdn.microsoft.com/en-us/library ... .103).aspx ) or, in case of fluent mapping, with the .HasColumnType(string columnType) method of property configuration (an example of application with fluent mapping and detailed description of Code-First peculiarities is available at http://www.devart.com/blogs/dotconnect/ ... qlite.html).