openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbobo <jbal...@wp.pl>
Subject Re: Missing PK Values
Date Tue, 11 Mar 2008 14:25:18 GMT

Hi,
I have the same problem. When I using driver
weblogic.jdbc.sybase.SybaseDriver and my PK is increment as @Identity for
Sybase database after persiste new model and invoke flush on EntityManager
ID is 0.
I tested other drivers, jconn3 working OK, but very very slow.  Have you
solution this problem ?



Dan Bush wrote:
> 
> I am using WL 10T and OpenJPA(0.9.7 nightly) against a Sybase(12.5.3)
> DB . My PK types are IDENTITY and I have the entities mapped like so:
> 
>        @Id
>        @GeneratedValue(strategy = GenerationType.IDENTITY)
>        @Column(name = "myPk")
>        private Long id;
> 
>        public Long getId() {    // i only have a setter ...
>                return id;
>        }
> 
> When I execute the following code, the PK comes back 0! :
> 
> Entity e = new EntityX();
> 
> _em.persist(entity);
> 
> // _em.flush();
> // _em.refresh() // tried this too
> 
> System.out.println(entity.getId()); // returning 0
> 
> 
> 
> It doesn't look like the PKs are being relayed back from the DB. Not
> sure if I have a driver issue or what(using the non XA WL Sybase
> driver). Even when I find an entity all the fields values seam to be
> working except for the pks. Anyone have any ideas?
> 
> 

-- 
View this message in context: http://www.nabble.com/Missing-PK-Values-tp9279712p15976543.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Mime
View raw message