Bug 353571 - Bug 297198 fix does not work with HSQLDB 2.x
Summary: Bug 297198 fix does not work with HSQLDB 2.x
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Server 2003
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard: submitted_patch
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 08:33 EDT by Fred Toussi CLA
Modified: 2022-06-09 10:35 EDT (History)
1 user (show)

See Also:
tom.ware: iplog+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Toussi CLA 2011-08-02 08:33:50 EDT
Build Identifier: 2.1.1

See bug 297198:

The solution breaks with HSQLDB 2.x. Version 1.8.x requires a comma between
"START BY 1" and "INCREMENT BY 1", while version 2.x complies with SQL:2008 and
does not accept the comma.

The previous fix added the unnecessary "INCREMENT BY 1" (increment is 1 by
default). If this is removed, it will work with all versions of 1.8.x and 2.x.

The method should be altered as follows:

public void printFieldIdentityClause(Writer writer) throws ValidationException
{
  try {
    writer.write(" GENERATED BY DEFAULT AS IDENTITY (START WITH 1)");
  } catch (IOException ex) {
    throw ValidationException.fileError(ex);
  }
}

Reproducible: Always
Comment 1 Tom Ware CLA 2011-08-02 09:02:34 EDT
The best way to work around this issue is to subclass the HSQL platform and include the method provided above.

The fix for this bug will involve inclduing a subclass such as the one describe above in the product and where possible enabling autodetection of it.
Comment 2 Fred Toussi CLA 2011-08-02 09:50:15 EDT
This fix will work with HSQLDB 1.8.x and 2.x and all future versions if it is applied to the current platform -- does not need subclassing. 

Subclassing the HSQL platform would be a good idea regadless of this. HSQLDB 2.x is very feature rich and standards compliant compared to 1.8.x. Main areas where subclassing will be of benefit are:

- transaction support for READ COMMITTED and SERIALIZABLE
- support for real, multithreaded MVCC with configurable behavior on data change conflict (rollback action or rollback transation)
- new data types cover full SQL:2008 foundation (BLOB, CLOB, WITH TIME ZONE, INTERVAL 
- fine grained configuration properties for relaxing SQL conformance and syntax and behavior compatibility with other SQL products

Adding platform support for the new features will extend test coverage of JPA features in EclipseLink

I can help with the implementation to auto-discover various settings for maximum flexibility. Please start a Bugzilla item if you want to go ahead and I will participate and attach patches if necessary.
Comment 3 Tom Ware CLA 2011-08-24 10:11:08 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 4 Fred Toussi CLA 2011-11-13 07:03:06 EST
Backward compatibility has been added in HSQLDB 2.2.6 to work with the legacy syntax.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:35:29 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink