You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by lawrencefinn <la...@gmail.com> on 2017/02/06 18:22:02 UTC

insert and update dml issues

I can't seem to get insert or update DML queries to work.  I have a simple
cache that I put one object in.  I try to update it, the result says 1 row
was updated, but nothing was actually updated in the object.  

Pojo:
public class ACLStatus {
    @QuerySqlField(index = true, name = "user_id")
    private Long userId;
    @QuerySqlField(index = true, name = "last_modified")
    private Date lastModified;

    public ACLStatus(Long userId, Date lastModified) {
        this.userId = userId;
        this.lastModified = lastModified;
    }

    public Long getUserId() {
        return userId;
    }

    public Date getLastModified() {
        return lastModified;
    }

    public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ACLStatus aclStatus = (ACLStatus) o;

        if (userId != null ? !userId.equals(aclStatus.userId) :
aclStatus.userId != null) return false;
        return lastModified != null ?
lastModified.equals(aclStatus.lastModified) : aclStatus.lastModified ==
null;
    }

    @Override
    public int hashCode() {
        int result = userId != null ? userId.hashCode() : 0;
        result = 31 * result + (lastModified != null ?
lastModified.hashCode() : 0);
        return result;
    }
}


Code:
cache.put(1L, new ACLStatus(123L, new Date()));
Execute query: update "aclsource".ACLStatus set last_modified = date
'2016-12-12' where _key = 1
Do a getAll on that query: list(list(1)) 
Get object from cache and date has not changed 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: insert and update dml issues

Posted by Alexander Paschenko <al...@gmail.com>.
Hey Lawrence,

This seems to be a known problem
https://issues.apache.org/jira/browse/IGNITE-4531
We have a fix for it that will be released with AI 1.9.

Regards,
Alex
9 февр. 2017 г. 3:54 AM пользователь "Denis Magda" <dm...@apache.org>
написал:

> Please join this thread looking at DML issues. If you prove that this is
> the issue there is a chance we squeeze the fix into 1.9 release.
>
> —
> Denis
>
> > On Feb 6, 2017, at 12:02 PM, vkulichenko <va...@gmail.com>
> wrote:
> >
> > Hi,
> >
> > Yes, feel free to create a ticket if there is a bug. Please create a unit
> > test that reproduces the issue and attach it there.
> >
> > -Val
> >
> >
> >
> > --
> > View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/insert-and-update-dml-issues-tp10456p10460.html
> > Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
>

Re: insert and update dml issues

Posted by Denis Magda <dm...@apache.org>.
Please join this thread looking at DML issues. If you prove that this is the issue there is a chance we squeeze the fix into 1.9 release.

—
Denis

> On Feb 6, 2017, at 12:02 PM, vkulichenko <va...@gmail.com> wrote:
> 
> Hi,
> 
> Yes, feel free to create a ticket if there is a bug. Please create a unit
> test that reproduces the issue and attach it there.
> 
> -Val
> 
> 
> 
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456p10460.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: insert and update dml issues

Posted by vkulichenko <va...@gmail.com>.
Hi,

Yes, feel free to create a ticket if there is a bug. Please create a unit
test that reproduces the issue and attach it there.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456p10460.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: insert and update dml issues

Posted by lawrencefinn <la...@gmail.com>.
Actually, I see the bug.  Apparently DML statements don't work with fields
that have "names" different than the java pojo name?  Should I file a
ticket?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456p10457.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.