You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Markus Reich <re...@gmail.com> on 2020/10/28 07:34:35 UTC

MariaDB column with auto increment

Hi,

I'm using Cayenne 4.1.
I have an an object A with an one to one relation to another object B,
in object B I got an column with an autoincrement field (no PK).
Now when I create an new object A / B the value of the column stays at 0.
I tried to refresh with object contexts invalidateObjects method and with a
RefreshQuery but it stays 0?

regards

-- 
*Markus Reich*
Waldweg 62
6393 St. Ulrich am Pillersee
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at

Re: MariaDB column with auto increment

Posted by Markus Reich <re...@gmail.com>.
ok, thx for the hint, I had to invalidate also object B, then the row got
fetched again :-)

Am Mi., 28. Okt. 2020 um 15:49 Uhr schrieb John Huss <jo...@gmail.com>:

> I'd turn on SQL logging and check that it is refetching the row via SQL.
> Also query the DB to verify the value is set there.
>
> log4j.logger.org.apache.cayenne.log.JdbcEventLogger = INFO
>
> On Wed, Oct 28, 2020 at 2:35 AM Markus Reich <re...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I'm using Cayenne 4.1.
> > I have an an object A with an one to one relation to another object B,
> > in object B I got an column with an autoincrement field (no PK).
> > Now when I create an new object A / B the value of the column stays at 0.
> > I tried to refresh with object contexts invalidateObjects method and
> with a
> > RefreshQuery but it stays 0?
> >
> > regards
> >
> > --
> > *Markus Reich*
> > Waldweg 62
> > 6393 St. Ulrich am Pillersee
> > www.markusreich.at / www.meeximum.at
> > markus.reich@markusreich.at
> >
>


-- 
*Markus Reich*
Waldweg 62
6393 St. Ulrich am Pillersee
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at

Re: MariaDB column with auto increment

Posted by John Huss <jo...@gmail.com>.
I'd turn on SQL logging and check that it is refetching the row via SQL.
Also query the DB to verify the value is set there.

log4j.logger.org.apache.cayenne.log.JdbcEventLogger = INFO

On Wed, Oct 28, 2020 at 2:35 AM Markus Reich <re...@gmail.com> wrote:

> Hi,
>
> I'm using Cayenne 4.1.
> I have an an object A with an one to one relation to another object B,
> in object B I got an column with an autoincrement field (no PK).
> Now when I create an new object A / B the value of the column stays at 0.
> I tried to refresh with object contexts invalidateObjects method and with a
> RefreshQuery but it stays 0?
>
> regards
>
> --
> *Markus Reich*
> Waldweg 62
> 6393 St. Ulrich am Pillersee
> www.markusreich.at / www.meeximum.at
> markus.reich@markusreich.at
>