Issue Details (XML | Word | Printable)

Key: NUCRDBMS-793
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Tate Poon
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

fail to create schema

Created: 27/Apr/14 05:37 PM   Updated: 13/May/14 02:40 PM   Resolved: 28/Apr/14 05:09 PM
Component/s: SchemaTool
Affects Version/s: 3.2.12
Fix Version/s: None

File Attachments: 1. Zip Archive NUCRDBMS-793.zip (65 kB)


Datastore: Other


 Description  « Hide
SQLite dose not accept "bigint PRIMARY KEY autoincrement".
We must use "INTEGER PRIMARY KEY autoincrement".

[schematool] SEVERE: Error thrown executing CREATE TABLE "TRANSACTION"
[schematool] (
[schematool] TRANSACTION_ID bigint PRIMARY KEY autoincrement,
[schematool] AMOUNT double NOT NULL,
[schematool] UNITPRICE double NOT NULL
[schematool] ) : [SQLITE_ERROR] SQL error or missing database (AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY)
[schematool] java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY)
[schematool] at org.sqlite.DB.newSQLException(DB.java:383)
[schematool] at org.sqlite.DB.newSQLException(DB.java:387)
[schematool] at org.sqlite.DB.throwex(DB.java:374)
[schematool] at org.sqlite.NativeDB.prepare(Native Method)
[schematool] at org.sqlite.DB.prepare(DB.java:123)
[schematool] at org.sqlite.Stmt.execute(Stmt.java:113)
[schematool] at org.datanucleus.store.rdbms.datasource.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

Andy Jefferson added a comment - 27/Apr/14 05:58 PM
All docs require a testcase that demonstrate something. Anything that has no means of reproduction will be closed after a period of time.

Andy Jefferson made changes - 27/Apr/14 05:58 PM
Field Original Value New Value
Priority Critical [ 2 ] No Testcase [ 6 ]
Tate Poon added a comment - 28/Apr/14 04:56 PM
Assume you have Apache Ant + Ivy installed,
execute the default target "testcase" to reproduce the issue.

Tate Poon made changes - 28/Apr/14 04:56 PM
Attachment NUCRDBMS-793.zip [ 12064 ]
Andy Jefferson added a comment - 28/Apr/14 05:09 PM
You mean SQLite will not allow AUTOINCREMENT on columns that are not INTEGER (which would have been a far more informative issue title than "fail to create schema" FWIW).
So you make the column in question an INTEGER. That is, after all, why JDO allows the specification of "jdbc-type".

@DatastoreIdentity(columns={@Column(jdbcType="integer")})

Andy Jefferson made changes - 28/Apr/14 05:09 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Fix [ 2 ]
Andy Jefferson made changes - 13/May/14 02:40 PM
Status Resolved [ 5 ] Closed [ 6 ]