[ 
https://issues.apache.org/jira/browse/EMPIREDB-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jan updated EMPIREDB-261:
-------------------------
    Description: 
When you write code like this:

cmd.set(DB.col1.to(col1));
cmd.set(DB.col2.to(col2));
// ...
cmd.set(DB.clob_col.to(string));

// try update
int updateCount = this.db.executeUpdate(cmd, this.conn);

if (updateCount < 1) {
        // not found, insert
        cmd.set(DB.id.to(id));
        this.db.executeInsert(cmd, this.conn);
}

clob_col will always be empty on the first run, because DBClobData uses a 
Reader internally, which is consumed on the update-try.

(Maybe BLOB/DBBlobData has the same issue)

  was:
If you write code like this:

{quote}cmd.set(DB.col1.to(col1));
cmd.set(DB.col2.to(col2));
// ...
cmd.set(DB.clob_col.to(string));

// try update
int updateCount = this.db.executeUpdate(cmd, this.conn);

if (updateCount < 1) {
        // not found, insert
        cmd.set(DB.id.to(id));
        this.db.executeInsert(cmd, this.conn);
}{quote}

clob_col will always be empty on the first run, because DBClobData uses a 
Reader internally, which is consumed on the update-try.

(Maybe BLOB/DBBlobData has the same issue)


> DBCommand is not re-usable, when a CLOB colum is involved
> ---------------------------------------------------------
>
>                 Key: EMPIREDB-261
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-261
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: empire-db-2.4.6
>            Reporter: jan
>
> When you write code like this:
> cmd.set(DB.col1.to(col1));
> cmd.set(DB.col2.to(col2));
> // ...
> cmd.set(DB.clob_col.to(string));
> // try update
> int updateCount = this.db.executeUpdate(cmd, this.conn);
> if (updateCount < 1) {
>         // not found, insert
>         cmd.set(DB.id.to(id));
>         this.db.executeInsert(cmd, this.conn);
> }
> clob_col will always be empty on the first run, because DBClobData uses a 
> Reader internally, which is consumed on the update-try.
> (Maybe BLOB/DBBlobData has the same issue)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to