openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fay Wang <fyw...@yahoo.com>
Subject Re: [jira] Created: (OPENJPA-736) Combine insert and select SQL together when for generated Id with strategy=GenerationType.IDENTITY
Date Wed, 01 Oct 2008 19:32:10 GMT
Yes, we will look into the getGeneratedKey in jdbc.


--- On Wed, 10/1/08, David Jencks <david_jencks@yahoo.com> wrote:

> From: David Jencks <david_jencks@yahoo.com>
> Subject: Re: [jira] Created: (OPENJPA-736) Combine insert and select SQL together when
 for generated Id with strategy=GenerationType.IDENTITY
> To: dev@openjpa.apache.org
> Date: Wednesday, October 1, 2008, 10:11 AM
> isn't there a db independent jdbc feature for this now?
> 
> thanks
> david jencks
> 
> On Oct 1, 2008, at 9:29 AM, Fay Wang (JIRA) wrote:
> 
> > Combine insert and select SQL together when  for
> generated Id with  
> > strategy=GenerationType.IDENTITY
> >
> ----------------------------------------------------------------------------------------------------
> >
> >                 Key: OPENJPA-736
> >                 URL:
> https://issues.apache.org/jira/browse/OPENJPA-736
> >             Project: OpenJPA
> >          Issue Type: Improvement
> >    Affects Versions: 1.3.0
> >            Reporter: Fay Wang
> >             Fix For: 1.3.0
> >
> >
> > Currently if the strategy of the generated id is  
> > GenerationType.IDENTITY,  when an entity object is
> created, openjpa  
> > will generate two SQL statements. The following is an
> example  
> > running on DB2:
> >
> > (1) INSERT INTO EntityA (col1, col2, col3, version)
> VALUES  
> > (?, ?, ?, ?)
> > [params=(int) 1, (int) 1, (int) 1, (int) 1]
> >
> > (2) SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1
> >
> > A performance improvement is to take advantage of the
> "select from  
> > final table" feature in DB2 to combine the insert
> and select  
> > statement into a single SQL statement as shown below:
> >
> > SELECT id FROM FINAL TABLE (INSERT INTO EntityA (col1,
> col2, col3,  
> > version) VALUES (?, ?, ?, ?) )
> >
> >
> > -- 
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the
> issue online.
> >


      

Mime
View raw message