You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by ben short <ja...@gmail.com> on 2007/09/20 11:05:46 UTC
SequenceGenerator not using cached ids.
Hi,
I have a simple class as shown below...
Entity
@SequenceGenerator(name="CategoryIdGen", sequenceName = "CategoryIdSeq")
public class Category
{
@Id
@Column(name="id")
@GeneratedValue(strategy= GenerationType.SEQUENCE, generator =
"CategoryIdGen")
private Long mId;
}
Given the following code and assuming that the sequence is equal to 0,
I would expect that category would get an id of 1 and category2 an id
of 2. But this is not the case, category gets an id of 1 and category
gets an id of 51.
EntityManager em = entityManagerFactory.createEntityManager();
em.getTransaction().begin();
Category category = new Category();
category.setName("Category");
category.setDescription("Category");
Category category2 = new Category();
category2.setName("Category");
category2.setDescription("Category");
em.persist(category);
em.persist(category2);
em.getTransaction().commit();
It would seem that the db allocates 50 ids at a time, as expected, yet
openjpa doesn't use them up, it just calls the generator again.
I'm using postgresql and openjpa-1.1.0-SNAPSHOT.
I have search the JIRA but cant see a bug of this description. Is this
a known issue?
Regards
Ben Short
Re: SequenceGenerator not using cached ids.
Posted by ben short <ja...@gmail.com>.
Further to this issue..
Running the following code...
conn = ds.getConnection();
Statement statement = conn.createStatement();
for ( int i = 0 ; i < 10 ; i++ )
{
ResultSet rs = statement.executeQuery("SELECT NEXTVAL('CategoryIdSeq')");
while (rs.next())
{
System.out.println(rs.getLong(1));
}
}
conn.commit();
conn.close();
Give the following output on run 1..
1
2
3
4
5
6
7
8
9
10
and this on run 2
51
52
53
54
55
56
57
58
59
60
Now with the following code...
for ( int i = 0 ; i < 10 ; i++ )
{
conn = ds.getConnection();
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery("SELECT NEXTVAL('CategoryIdSeq')");
while (rs.next())
{
System.out.println(rs.getLong(1));
}
conn.commit();
conn.close();
}
Run 1 outputs..
101
151
201
251
301
351
401
451
501
551
and run 2 outputs..
601
651
701
751
801
851
901
951
1001
1051
So it seems that the db will assign and cache the configured amount of
ids and they will be returened by the select nextval sql. But if the
connection is closed the db will assign another range of ips for that
connection.
Looking back at the logging output I posted it shows that a conneciton
is opened, commited then closed for every sql statement executed. I
think this explains what im seeing.
Looking at my test app and its spring configuration, the tx manager
will use a new connection everytime I call the storeCategory() method
of my CategoryDAO which explains why the ids are being assign as they
are.
Regards
Ben
Re: SequenceGenerator not using cached ids.
Posted by Craig L Russell <Cr...@Sun.COM>.
Seems like what you want is the sequence definition in PG to have an
increment of say 100, and then the SELECT NEXTVAL will return 1, 101,
201, etc. So the OpenJPA implementation should know that the NEXTVAL
is going to be incremented by 100 and should internally dispense the
100 ids that the NEXTVAL gave it.
Craig
On Sep 21, 2007, at 2:27 AM, ben short wrote:
> Patrick,
>
> Here are the document pages
>
> [1] http://www.postgresql.org/docs/8.2/interactive/sql-
> createsequence.html
> [2] http://www.postgresql.org/docs/8.2/interactive/functions-
> sequence.html
>
> And my DDL
>
> CREATE SEQUENCE categoryidseq
> INCREMENT 1
> MINVALUE 1
> MAXVALUE 9223372036854775807
> START 100
> CACHE 50;
> ALTER TABLE categoryidseq OWNER TO jpa;
>
> I can then use it via pgAdmin with the following sql..
>
> SELECT nextval('categoryidseq');
>
> And it returns id's incemented by 1.
>
> Regards
>
> Ben
>
> On 9/21/07, Patrick Linskey <pl...@gmail.com> wrote:
>> Yep, I think that this is a bug of some sort. We're using the
>> sequence:
>>
>> 28516313> executing prepstmnt 1772552 SELECT NEXTVAL('CategoryIdSeq')
>>
>> but we're just selecting the next value, not the increment size. It's
>> weird that we are then using the increment size in the returned
>> values, though.
>>
>> Does anyone know the syntax in Postgres to select a batch of
>> numbers from a seq?
>>
>> -Patrick
>>
>> On 9/20/07, ben short <ja...@gmail.com> wrote:
>>> My work around was to set the allocationSize property to 1, but that
>>> kind of defeats the point of caching the id's.
>>>
>>> Regards
>>>
>>> Ben
>>>
>>> On 9/20/07, Takeichi Kanzaki Cabrera <tk...@gmail.com> wrote:
>>>> I have the same problem using postgresql + openjpa-1.0 and at this
>>>> time I have no solution for it.
>>>>
>>>> --
>>>> Regards,
>>>> Takeichi Kanzaki Cabrera
>>>> Linux Registered User #308138
>>>>
>>>> If you want to be original,
>>>> be your self.
>>>>
>>>
>>
>>
>> --
>> Patrick Linskey
>> 202 669 5907
>>
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!
Re: SequenceGenerator not using cached ids.
Posted by ben short <ja...@gmail.com>.
Patrick,
Here are the document pages
[1] http://www.postgresql.org/docs/8.2/interactive/sql-createsequence.html
[2] http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html
And my DDL
CREATE SEQUENCE categoryidseq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 100
CACHE 50;
ALTER TABLE categoryidseq OWNER TO jpa;
I can then use it via pgAdmin with the following sql..
SELECT nextval('categoryidseq');
And it returns id's incemented by 1.
Regards
Ben
On 9/21/07, Patrick Linskey <pl...@gmail.com> wrote:
> Yep, I think that this is a bug of some sort. We're using the sequence:
>
> 28516313> executing prepstmnt 1772552 SELECT NEXTVAL('CategoryIdSeq')
>
> but we're just selecting the next value, not the increment size. It's
> weird that we are then using the increment size in the returned
> values, though.
>
> Does anyone know the syntax in Postgres to select a batch of numbers from a seq?
>
> -Patrick
>
> On 9/20/07, ben short <ja...@gmail.com> wrote:
> > My work around was to set the allocationSize property to 1, but that
> > kind of defeats the point of caching the id's.
> >
> > Regards
> >
> > Ben
> >
> > On 9/20/07, Takeichi Kanzaki Cabrera <tk...@gmail.com> wrote:
> > > I have the same problem using postgresql + openjpa-1.0 and at this
> > > time I have no solution for it.
> > >
> > > --
> > > Regards,
> > > Takeichi Kanzaki Cabrera
> > > Linux Registered User #308138
> > >
> > > If you want to be original,
> > > be your self.
> > >
> >
>
>
> --
> Patrick Linskey
> 202 669 5907
>
Re: SequenceGenerator not using cached ids.
Posted by Patrick Linskey <pl...@gmail.com>.
Yep, I think that this is a bug of some sort. We're using the sequence:
28516313> executing prepstmnt 1772552 SELECT NEXTVAL('CategoryIdSeq')
but we're just selecting the next value, not the increment size. It's
weird that we are then using the increment size in the returned
values, though.
Does anyone know the syntax in Postgres to select a batch of numbers from a seq?
-Patrick
On 9/20/07, ben short <ja...@gmail.com> wrote:
> My work around was to set the allocationSize property to 1, but that
> kind of defeats the point of caching the id's.
>
> Regards
>
> Ben
>
> On 9/20/07, Takeichi Kanzaki Cabrera <tk...@gmail.com> wrote:
> > I have the same problem using postgresql + openjpa-1.0 and at this
> > time I have no solution for it.
> >
> > --
> > Regards,
> > Takeichi Kanzaki Cabrera
> > Linux Registered User #308138
> >
> > If you want to be original,
> > be your self.
> >
>
--
Patrick Linskey
202 669 5907
Re: SequenceGenerator not using cached ids.
Posted by ben short <ja...@gmail.com>.
My work around was to set the allocationSize property to 1, but that
kind of defeats the point of caching the id's.
Regards
Ben
On 9/20/07, Takeichi Kanzaki Cabrera <tk...@gmail.com> wrote:
> I have the same problem using postgresql + openjpa-1.0 and at this
> time I have no solution for it.
>
> --
> Regards,
> Takeichi Kanzaki Cabrera
> Linux Registered User #308138
>
> If you want to be original,
> be your self.
>
Re: SequenceGenerator not using cached ids.
Posted by Takeichi Kanzaki Cabrera <tk...@gmail.com>.
I have the same problem using postgresql + openjpa-1.0 and at this
time I have no solution for it.
--
Regards,
Takeichi Kanzaki Cabrera
Linux Registered User #308138
If you want to be original,
be your self.
Re: SequenceGenerator not using cached ids.
Posted by ben short <ja...@gmail.com>.
Patrick,
This is a re post [1] , I got zero response from the last time, i
wonder if that's what you are thinking of?
I'm doing no configuration apart from what you can see in class.
Here's the log..
log4j:WARN No appenders could be found for logger
(org.springframework.util.ClassUtils).
log4j:WARN Please initialize the log4j system properly.
0 openjpa WARN [main] openjpa.Runtime - The property named
"openjpa.RuntimeUnenhancedClasses" was not recognized and will be
ignored.
16 openjpa WARN [main] openjpa.Runtime - The property named
"openjpa.RuntimeUnenhancedClasses" was not recognized and will be
ignored.
16 openjpa WARN [main] openjpa.Runtime - An error occurred while
registering a ClassTransformer with PersistenceUnitInfo: name
'openjpa', root URL
[file:/C:/Documents%20and%20Settings/Ben/My%20Documents/Programming/Projects/eshop-new-product-types/eshop-core/target/classes/].
The error has been consumed. To see it, set your openjpa.Runtime log
level to TRACE. Load-time class transformation will not be available.
47 openjpa INFO [main] openjpa.Runtime - Starting OpenJPA 1.1.0-SNAPSHOT
94 openjpa INFO [main] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc.sql.PostgresDictionary".
579 openjpa TRACE [main] openjpa.jdbc.JDBC - catalogSeparator: .
catalogTerm: database
databaseProductName: PostgreSQL
databaseProductVersion: 8.1.9
driverName: PostgreSQL Native Driver
driverVersion: PostgreSQL 8.2 JDBC3 with SSL (build 504)
extraNameCharacters:
identifierQuoteString: "
numericFunctions:
abs,acos,asin,atan,atan2,ceiling,cos,cot,degrees,exp,floor,log,log10,mod,pi,power,radians,rand,round,sign,sin,sqrt,tan,truncate
procedureTerm: function
schemaTerm: schema
searchStringEscape: \\
sqlKeywords: abort,acl,add,aggregate,append,archive,arch_store,backward,binary,boolean,change,cluster,copy,database,delimiter,delimiters,do,extend,explain,forward,heavy,index,inherits,isnull,light,listen,load,merge,nothing,notify,notnull,oids,purge,rename,replace,retrieve,returns,rule,recipe,setof,stdin,stdout,store,vacuum,verbose,version
stringFunctions:
ascii,char,concat,lcase,left,length,ltrim,repeat,rtrim,space,substring,ucase,replace
systemFunctions: database,ifnull,user
timeDateFunctions:
curdate,curtime,dayname,dayofmonth,dayofweek,dayofyear,hour,minute,month,monthname,now,quarter,second,week,year,timestampadd
url: jdbc:postgresql://192.168.100.32/jpa
userName: jpa
defaultTransactionIsolation: 2
driverMajorVersion: 8
driverMinorVersion: 2
maxBinaryLiteralLength: 0
maxCatalogNameLength: 63
maxCharLiteralLength: 0
maxColumnNameLength: 63
maxColumnsInGroupBy: 0
maxColumnsInIndex: 32
maxColumnsInOrderBy: 0
maxColumnsInSelect: 0
maxColumnsInTable: 1600
maxConnections: 8192
maxCursorNameLength: 63
maxIndexLength: 0
maxProcedureNameLength: 63
maxRowSize: 1073741824
maxSchemaNameLength: 63
maxStatementLength: 0
maxStatements: 0
maxTableNameLength: 63
maxTablesInSelect: 0
maxUserNameLength: 63
isCatalogAtStart: true
isReadOnly: false
nullPlusNonNullIsNull: true
nullsAreSortedAtEnd: false
nullsAreSortedAtStart: false
nullsAreSortedHigh: true
nullsAreSortedLow: false
storesLowerCaseIdentifiers: true
storesLowerCaseQuotedIdentifiers: false
storesMixedCaseIdentifiers: false
storesMixedCaseQuotedIdentifiers: false
storesUpperCaseIdentifiers: false
storesUpperCaseQuotedIdentifiers: false
supportsAlterTableWithAddColumn: true
supportsAlterTableWithDropColumn: true
supportsANSI92EntryLevelSQL: true
supportsANSI92FullSQL: false
supportsANSI92IntermediateSQL: false
supportsCatalogsInDataManipulation: false
supportsCatalogsInIndexDefinitions: false
supportsCatalogsInPrivilegeDefinitions: false
supportsCatalogsInProcedureCalls: false
supportsCatalogsInTableDefinitions: false
supportsColumnAliasing: true
supportsConvert: false
supportsCoreSQLGrammar: false
supportsCorrelatedSubqueries: true
supportsDataDefinitionAndDataManipulationTransactions: true
supportsDataManipulationTransactionsOnly: false
supportsDifferentTableCorrelationNames: false
supportsExpressionsInOrderBy: true
supportsExtendedSQLGrammar: false
supportsFullOuterJoins: true
supportsGroupBy: true
supportsGroupByBeyondSelect: true
supportsGroupByUnrelated: true
supportsIntegrityEnhancementFacility: true
supportsLikeEscapeClause: true
supportsLimitedOuterJoins: true
supportsMinimumSQLGrammar: true
supportsMixedCaseIdentifiers: false
supportsMixedCaseQuotedIdentifiers: true
supportsMultipleResultSets: true
supportsMultipleTransactions: true
supportsNonNullableColumns: true
supportsOpenCursorsAcrossCommit: false
supportsOpenCursorsAcrossRollback: false
supportsOpenStatementsAcrossCommit: true
supportsOpenStatementsAcrossRollback: true
supportsOrderByUnrelated: true
supportsOuterJoins: true
supportsPositionedDelete: false
supportsPositionedUpdate: false
supportsSchemasInDataManipulation: true
supportsSchemasInIndexDefinitions: true
supportsSchemasInPrivilegeDefinitions: true
supportsSchemasInProcedureCalls: true
supportsSchemasInTableDefinitions: true
supportsSelectForUpdate: true
supportsStoredProcedures: true
supportsSubqueriesInComparisons: true
supportsSubqueriesInExists: true
supportsSubqueriesInIns: true
supportsSubqueriesInQuantifieds: true
supportsTableCorrelationNames: true
supportsTransactions: true
supportsUnion: true
supportsUnionAll: true
usesLocalFilePerTable: false
usesLocalFiles: false
allProceduresAreCallable: true
allTablesAreSelectable: true
dataDefinitionCausesTransactionCommit: false
dataDefinitionIgnoredInTransactions: false
doesMaxRowSizeIncludeBlobs: false
supportsBatchUpdates: true
610 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, abstractproduct, null
625 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, attributedproduct, null
625 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, attributedproductattribute, null
641 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, attributedproductattributeandvalue,
null
641 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, attributedproductattributevalue, null
657 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null,
attributedproductattribute_attributedproductattributevalue, null
657 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, attributedproductbasketitem, null
672 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, attributedproductinstance, null
672 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null,
attributedproduct_attributedproductattribute, null
688 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null,
attributedproduct_attributedproductinstance, null
688 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, basket, null
704 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, basketitem, null
704 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, basket_basketitem, null
719 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, category, null
719 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, configurableproduct, null
719 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, simpleproduct, null
735 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> getColumns: jpa, null, simpleproductbasketitem, null
750 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
33344123> executing prepstmnt 595232 SELECT NULL AS SEQUENCE_SCHEMA,
relname AS SEQUENCE_NAME FROM pg_class WHERE relkind='S'
750 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
33344123> [0 ms] spent
750 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> [0 ms] commit
750 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
33344123> [0 ms] close
766 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19716308> [0 ms] commit
766 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19716308> [0 ms] close
766 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21975073> [0 ms] rollback
766 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21975073> executing stmnt 14205934 CREATE SEQUENCE
AbstractProductIdSeq START WITH 1
797 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21975073> [15 ms] spent
797 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21975073> [0 ms] commit
797 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21975073> [0 ms] close
797 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19364400> [0 ms] rollback
813 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
19364400> executing stmnt 13043649 CREATE SEQUENCE
AttributedProductAttributeAndValueIdSeq START WITH 1
813 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
19364400> [0 ms] spent
813 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19364400> [0 ms] commit
813 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19364400> [0 ms] close
829 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13515618> [0 ms] rollback
829 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
13515618> executing stmnt 27052915 CREATE SEQUENCE
AttributedProductAttributeIdGen START WITH 1
829 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
13515618> [0 ms] spent
829 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13515618> [0 ms] commit
829 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13515618> [0 ms] close
844 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
22768301> [0 ms] rollback
844 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
22768301> executing stmnt 12095708 CREATE SEQUENCE
AttributedProductAttributeValueIdSeq START WITH 1
844 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
22768301> [0 ms] spent
844 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
22768301> [0 ms] commit
860 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
22768301> [0 ms] close
860 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19823798> [0 ms] rollback
860 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
19823798> executing stmnt 16620439 CREATE SEQUENCE
AttributedProductInstanceIdGen START WITH 1
875 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
19823798> [15 ms] spent
875 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19823798> [0 ms] commit
875 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
19823798> [0 ms] close
875 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
5062879> [0 ms] rollback
875 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
5062879> executing stmnt 31327262 CREATE SEQUENCE BasketIdSeq START
WITH 1
891 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
5062879> [16 ms] spent
891 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
5062879> [0 ms] commit
891 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
5062879> [0 ms] close
891 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14703318> [0 ms] rollback
891 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
14703318> executing stmnt 23836633 CREATE SEQUENCE BasketItemIdSeq
START WITH 1
907 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
14703318> [16 ms] spent
907 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14703318> [0 ms] commit
907 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14703318> [0 ms] close
907 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
15943388> [0 ms] rollback
907 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
15943388> executing stmnt 28394800 CREATE SEQUENCE CategoryIdSeq START
WITH 1 CACHE 50
922 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
15943388> [15 ms] spent
922 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
15943388> [0 ms] commit
922 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
15943388> [0 ms] close
922 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20285311> [0 ms] rollback
922 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
20285311> executing stmnt 22198005 CREATE TABLE AbstractProduct (id
BIGINT NOT NULL, created ABSTIME NOT NULL, description VARCHAR(2048)
NOT NULL, made_to_order BOOL NOT NULL, name VARCHAR(64) NOT NULL,
updated ABSTIME NOT NULL, category BIGINT NOT NULL, PRIMARY KEY (id))
969 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
20285311> [47 ms] spent
969 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20285311> [0 ms] commit
969 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20285311> [0 ms] close
969 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20791853> [0 ms] rollback
969 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
20791853> executing stmnt 12832866 CREATE TABLE AttributedProduct (id
BIGINT NOT NULL, PRIMARY KEY (id))
1000 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
20791853> [31 ms] spent
1000 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20791853> [0 ms] commit
1000 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20791853> [0 ms] close
1000 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1640159> [0 ms] rollback
1000 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
1640159> executing stmnt 17972319 CREATE TABLE
AttributedProductAttribute (id BIGINT NOT NULL, name VARCHAR(64) NOT
NULL, PRIMARY KEY (id), UNIQUE (name))
1047 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
1640159> [32 ms] spent
1047 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1640159> [0 ms] commit
1047 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1640159> [0 ms] close
1047 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6908255> [0 ms] rollback
1047 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
6908255> executing stmnt 8707644 CREATE TABLE
AttributedProductAttributeAndValue (id INTEGER NOT NULL, instance
INTEGER, attribute BIGINT, value BIGINT, PRIMARY KEY (id))
1079 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
6908255> [32 ms] spent
1079 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6908255> [0 ms] commit
1079 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6908255> [0 ms] close
1079 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6588728> [0 ms] rollback
1079 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
6588728> executing stmnt 7126735 CREATE TABLE
AttributedProductAttributeValue (id BIGINT NOT NULL, value
VARCHAR(128) NOT NULL, PRIMARY KEY (id))
1110 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
6588728> [31 ms] spent
1110 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6588728> [0 ms] commit
1110 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6588728> [0 ms] close
1110 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1784167> [0 ms] rollback
1110 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
1784167> executing stmnt 22402238 CREATE TABLE
AttributedProductAttribute_AttributedProductAttributeValue
(AttributedProductAttribute_id BIGINT, mValues_id BIGINT)
1125 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
1784167> [15 ms] spent
1125 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1784167> [0 ms] commit
1125 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1784167> [0 ms] close
1125 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
3919472> [0 ms] rollback
1125 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
3919472> executing stmnt 7231150 CREATE TABLE
AttributedProductBasketItem (id BIGINT NOT NULL,
attributedProductInstance_id INTEGER, PRIMARY KEY (id))
1157 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
3919472> [32 ms] spent
1157 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
3919472> [0 ms] commit
1157 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
3919472> [0 ms] close
1157 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
9958945> [0 ms] rollback
1157 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
9958945> executing stmnt 10496057 CREATE TABLE
AttributedProductInstance (id INTEGER NOT NULL, price FLOAT8 NOT NULL,
stock BIGINT NOT NULL, weight FLOAT8 NOT NULL, PRIMARY KEY (id))
1188 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
9958945> [31 ms] spent
1188 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
9958945> [0 ms] commit
1188 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
9958945> [0 ms] close
1188 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
30579320> [0 ms] rollback
1188 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
30579320> executing stmnt 26960421 CREATE TABLE
AttributedProduct_AttributedProductAttribute (AttributedProduct_id
BIGINT, mAttributes_id BIGINT)
1204 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
30579320> [16 ms] spent
1204 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
30579320> [0 ms] commit
1204 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
30579320> [0 ms] close
1204 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14512731> [0 ms] rollback
1219 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
14512731> executing stmnt 8310913 CREATE TABLE
AttributedProduct_AttributedProductInstance (AttributedProduct_id
BIGINT, mInstances_id INTEGER)
1219 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
14512731> [0 ms] spent
1219 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14512731> [0 ms] commit
1219 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14512731> [0 ms] close
1219 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20052249> [0 ms] rollback
1235 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
20052249> executing stmnt 31003492 CREATE TABLE Basket (id BIGINT NOT
NULL, created ABSTIME NOT NULL, updated ABSTIME NOT NULL, PRIMARY KEY
(id))
1250 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
20052249> [15 ms] spent
1250 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20052249> [0 ms] commit
1250 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
20052249> [0 ms] close
1266 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
10664453> [0 ms] rollback
1266 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
10664453> executing stmnt 23240342 CREATE TABLE BasketItem (id BIGINT
NOT NULL, quantity BIGINT, PRIMARY KEY (id))
1282 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
10664453> [16 ms] spent
1282 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
10664453> [0 ms] commit
1282 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
10664453> [0 ms] close
1297 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
16318274> [0 ms] rollback
1297 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
16318274> executing stmnt 20865862 CREATE TABLE Basket_BasketItem
(Basket_id BIGINT, basketItems_id BIGINT)
1297 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
16318274> [0 ms] spent
1297 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
16318274> [0 ms] commit
1297 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
16318274> [0 ms] close
1313 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
30095183> [0 ms] rollback
1313 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
30095183> executing stmnt 10248705 CREATE TABLE Category (id BIGINT
NOT NULL, description VARCHAR(512) NOT NULL, name VARCHAR(64) NOT
NULL, PRIMARY KEY (id))
1344 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
30095183> [31 ms] spent
1344 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
30095183> [0 ms] commit
1344 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
30095183> [0 ms] close
1344 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
32187507> [0 ms] rollback
1344 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
32187507> executing stmnt 10887413 CREATE TABLE ConfigurableProduct
(id BIGINT NOT NULL, PRIMARY KEY (id))
1375 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
32187507> [31 ms] spent
1375 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
32187507> [0 ms] commit
1375 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
32187507> [0 ms] close
1375 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6387076> [0 ms] rollback
1375 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
6387076> executing stmnt 6966554 CREATE TABLE SimpleProduct (id BIGINT
NOT NULL, price FLOAT8 NOT NULL, stock BIGINT NOT NULL, weight FLOAT8
NOT NULL, PRIMARY KEY (id))
1407 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
6387076> [32 ms] spent
1407 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6387076> [0 ms] commit
1407 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
6387076> [0 ms] close
1407 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1042586> [0 ms] rollback
1407 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
1042586> executing stmnt 7330981 CREATE TABLE SimpleProductBasketItem
(id BIGINT NOT NULL, simpleProduct_id BIGINT, PRIMARY KEY (id))
1438 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
1042586> [31 ms] spent
1438 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1042586> [0 ms] commit
1438 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
1042586> [0 ms] close
1438 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
32351822> [0 ms] rollback
1438 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
32351822> executing stmnt 21059367 CREATE INDEX I_BSTRDCT_MCATEGORY ON
AbstractProduct (category)
1469 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
32351822> [15 ms] spent
1469 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
32351822> [0 ms] commit
1469 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
32351822> [0 ms] close
1469 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
12647566> [0 ms] rollback
1469 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
12647566> executing stmnt 324332 CREATE INDEX I_TTRBDVL_MATTRIBUTE ON
AttributedProductAttributeAndValue (attribute)
1500 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
12647566> [31 ms] spent
1500 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
12647566> [0 ms] commit
1500 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
12647566> [0 ms] close
1500 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
15235194> [0 ms] rollback
1500 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
15235194> executing stmnt 4047165 CREATE INDEX I_TTRBDVL_MINSTANCE ON
AttributedProductAttributeAndValue (instance)
1532 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
15235194> [32 ms] spent
1532 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
15235194> [0 ms] commit
1532 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
15235194> [0 ms] close
1532 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
5872987> [0 ms] rollback
1532 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
5872987> executing stmnt 11025450 CREATE INDEX I_TTRBDVL_MVALUE ON
AttributedProductAttributeAndValue (value)
1547 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
5872987> [15 ms] spent
1547 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
5872987> [0 ms] commit
1547 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
5872987> [0 ms] close
1563 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
17168934> [0 ms] rollback
1563 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
17168934> executing stmnt 23713629 CREATE INDEX
I_TTRBTVL_ATTRIBUTEDPRODUCTATTRIBUTE_ID ON
AttributedProductAttribute_AttributedProductAttributeValue
(AttributedProductAttribute_id)
1579 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
17168934> [16 ms] spent
1579 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
17168934> [0 ms] commit
1579 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
17168934> [0 ms] close
1594 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28983641> [0 ms] rollback
1594 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
28983641> executing stmnt 18367270 CREATE INDEX I_TTRBTVL_ELEMENT ON
AttributedProductAttribute_AttributedProductAttributeValue
(mValues_id)
1610 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
28983641> [16 ms] spent
1610 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28983641> [0 ms] commit
1610 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28983641> [0 ms] close
1625 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13455789> [0 ms] rollback
1625 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
13455789> executing stmnt 28138822 CREATE INDEX
I_TTRBTTM_ATTRIBUTEDPRODUCTINSTANCE ON AttributedProductBasketItem
(attributedProductInstance_id)
1641 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
13455789> [16 ms] spent
1641 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13455789> [0 ms] commit
1641 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13455789> [0 ms] close
1657 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13018016> [0 ms] rollback
1657 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
13018016> executing stmnt 18909403 CREATE INDEX
I_TTRBRBT_ATTRIBUTEDPRODUCT_ID ON
AttributedProduct_AttributedProductAttribute (AttributedProduct_id)
1672 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
13018016> [15 ms] spent
1672 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13018016> [0 ms] commit
1672 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
13018016> [0 ms] close
1688 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
16318775> [0 ms] rollback
1688 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
16318775> executing stmnt 29283281 CREATE INDEX I_TTRBRBT_ELEMENT ON
AttributedProduct_AttributedProductAttribute (mAttributes_id)
1704 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
16318775> [16 ms] spent
1704 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
16318775> [0 ms] commit
1704 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
16318775> [0 ms] close
1704 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21250902> [0 ms] rollback
1719 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21250902> executing stmnt 10546114 CREATE INDEX
I_TTRBTNC_ATTRIBUTEDPRODUCT_ID ON
AttributedProduct_AttributedProductInstance (AttributedProduct_id)
1735 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21250902> [16 ms] spent
1735 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21250902> [0 ms] commit
1735 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21250902> [0 ms] close
1735 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14029569> [0 ms] rollback
1735 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
14029569> executing stmnt 7982345 CREATE INDEX I_TTRBTNC_ELEMENT ON
AttributedProduct_AttributedProductInstance (mInstances_id)
1766 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
14029569> [31 ms] spent
1766 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14029569> [0 ms] commit
1766 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
14029569> [0 ms] close
1766 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
8659118> [0 ms] rollback
1766 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
8659118> executing stmnt 8239415 CREATE INDEX I_BSKTTTM_BASKET_ID ON
Basket_BasketItem (Basket_id)
1797 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
8659118> [31 ms] spent
1797 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
8659118> [0 ms] commit
1797 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
8659118> [0 ms] close
1797 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
22751448> [0 ms] rollback
1797 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
22751448> executing stmnt 30836962 CREATE INDEX I_BSKTTTM_ELEMENT ON
Basket_BasketItem (basketItems_id)
1829 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
22751448> [32 ms] spent
1829 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
22751448> [0 ms] commit
1829 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
22751448> [0 ms] close
1829 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28630940> [0 ms] rollback
1829 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
28630940> executing stmnt 29663640 CREATE INDEX
I_SMPLTTM_SIMPLEPRODUCT ON SimpleProductBasketItem (simpleProduct_id)
1860 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
28630940> [31 ms] spent
1860 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28630940> [0 ms] commit
1860 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28630940> [0 ms] close
4797 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
28516313> executing prepstmnt 1772552 SELECT NEXTVAL('CategoryIdSeq')
4797 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
28516313> [0 ms] spent
4813 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28516313> [16 ms] commit
4813 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
28516313> [0 ms] close
4860 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
2044542> executing prepstmnt 12855300 SELECT NEXTVAL('CategoryIdSeq')
4875 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
2044542> [15 ms] spent
4875 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
2044542> [0 ms] commit
4875 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
2044542> [0 ms] close
4891 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21497715> executing prepstmnt 49194 INSERT INTO Category (id,
description, name) VALUES (?, ?, ?) [params=(long) 51, (String)
Category, (String) Category]
4907 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21497715> [0 ms] spent
4907 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21497715> executing prepstmnt 11108200 INSERT INTO Category (id,
description, name) VALUES (?, ?, ?) [params=(long) 1, (String)
Category, (String) Category]
4907 openjpa TRACE [main] openjpa.jdbc.SQL - <t 15580328, conn
21497715> [0 ms] spent
4907 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21497715> [0 ms] commit
4907 openjpa TRACE [main] openjpa.jdbc.JDBC - <t 15580328, conn
21497715> [0 ms] close
[1] http://www.nabble.com/%40SequenceGenerator-question-tf4388615.html#a12512482
On 9/20/07, Patrick Linskey <pl...@gmail.com> wrote:
> Hi,
>
> Have you done any other configuration of the sequence elsewhere? Also,
> can you turn SQL and JDBC logging to TRACE and post the logs?
>
> I think I remember a thread about a similar topic in the last couple
> of months, btw. I don't remember what, if anything, the resolution
> was.
>
> -Patrick
>
> On 9/20/07, ben short <ja...@gmail.com> wrote:
> > Hi,
> >
> > I have a simple class as shown below...
> >
> > Entity
> > @SequenceGenerator(name="CategoryIdGen", sequenceName = "CategoryIdSeq")
> > public class Category
> > {
> > @Id
> > @Column(name="id")
> > @GeneratedValue(strategy= GenerationType.SEQUENCE, generator =
> > "CategoryIdGen")
> > private Long mId;
> > }
> >
> > Given the following code and assuming that the sequence is equal to 0,
> > I would expect that category would get an id of 1 and category2 an id
> > of 2. But this is not the case, category gets an id of 1 and category
> > gets an id of 51.
> >
> > EntityManager em = entityManagerFactory.createEntityManager();
> >
> > em.getTransaction().begin();
> >
> > Category category = new Category();
> > category.setName("Category");
> > category.setDescription("Category");
> > Category category2 = new Category();
> > category2.setName("Category");
> > category2.setDescription("Category");
> >
> > em.persist(category);
> >
> > em.persist(category2);
> >
> > em.getTransaction().commit();
> >
> > It would seem that the db allocates 50 ids at a time, as expected, yet
> > openjpa doesn't use them up, it just calls the generator again.
> >
> > I'm using postgresql and openjpa-1.1.0-SNAPSHOT.
> >
> > I have search the JIRA but cant see a bug of this description. Is this
> > a known issue?
> >
> > Regards
> >
> > Ben Short
> >
>
>
> --
> Patrick Linskey
> 202 669 5907
>
Re: SequenceGenerator not using cached ids.
Posted by Patrick Linskey <pl...@gmail.com>.
Hi,
Have you done any other configuration of the sequence elsewhere? Also,
can you turn SQL and JDBC logging to TRACE and post the logs?
I think I remember a thread about a similar topic in the last couple
of months, btw. I don't remember what, if anything, the resolution
was.
-Patrick
On 9/20/07, ben short <ja...@gmail.com> wrote:
> Hi,
>
> I have a simple class as shown below...
>
> Entity
> @SequenceGenerator(name="CategoryIdGen", sequenceName = "CategoryIdSeq")
> public class Category
> {
> @Id
> @Column(name="id")
> @GeneratedValue(strategy= GenerationType.SEQUENCE, generator =
> "CategoryIdGen")
> private Long mId;
> }
>
> Given the following code and assuming that the sequence is equal to 0,
> I would expect that category would get an id of 1 and category2 an id
> of 2. But this is not the case, category gets an id of 1 and category
> gets an id of 51.
>
> EntityManager em = entityManagerFactory.createEntityManager();
>
> em.getTransaction().begin();
>
> Category category = new Category();
> category.setName("Category");
> category.setDescription("Category");
> Category category2 = new Category();
> category2.setName("Category");
> category2.setDescription("Category");
>
> em.persist(category);
>
> em.persist(category2);
>
> em.getTransaction().commit();
>
> It would seem that the db allocates 50 ids at a time, as expected, yet
> openjpa doesn't use them up, it just calls the generator again.
>
> I'm using postgresql and openjpa-1.1.0-SNAPSHOT.
>
> I have search the JIRA but cant see a bug of this description. Is this
> a known issue?
>
> Regards
>
> Ben Short
>
--
Patrick Linskey
202 669 5907