[Hibernate-JIRA] Created: (HHH-3029) use_sql_commants fails on Derby
by Oleksandr Alesinskyy (JIRA)
use_sql_commants fails on Derby
-------------------------------
Key: HHH-3029
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3029
Project: Hibernate3
Issue Type: Bug
Environment: WinXP, SP2 Java 1.5..0_12, Spring 2.0.7, Hibernate 3.2.5ga, Derby 10.3.2.1
Reporter: Oleksandr Alesinskyy
Activation is use_sql_comments cause SQL exception
/* insert de.ntec.lms.impl.P1Bean
*/ insert
into
P1
(VERSION, CELL_POS, CODE, CELL_ID, PLACE_ID)
values
(?, ?, ?, ?, ?)
2007-12-25 11:46:29,406 WARN org.hibernate.util.JDBCExceptionReporter
SQL Error: -1, SQLState: 42X01
2007-12-25 11:46:29,406 ERROR org.hibernate.util.JDBCExceptionReporter
Syntaxfehler: Encountered "/" at line 1, column 1.
2007-12-25 11:46:29,487 ERROR org.hibernate.event.def.AbstractFlushingEventListener
Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: could not insert: [de.ntec.lms.impl.P1Bean]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2078)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at de.ntec.lms.impl.PerformanceTest.doMain(PerformanceTest.java:84)
at de.ntec.lms.impl.PerformanceTest.main(PerformanceTest.java:46)
Caused by: java.sql.SQLException: Syntaxfehler: Encountered "/" at line 1, column 1.
at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:185)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:278)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:93)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:86)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:171)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2048)
... 12 more
Caused by: org.apache.derby.client.am.SqlException: Syntaxfehler: Encountered "/" at line 1, column 1.
at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
at org.apache.derby.client.am.Connection.prepareStatementX(Unknown Source)
... 20 more
Hibernate settings (via Spring)
<property name="manglableMappingResources">
<list>
<value>de/ntec/lms/impl/P1Bean.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.DerbyDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.use_sql_comments">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
</props>
</property>
When use_sql_comments is false all works smoothly.
Failing code
P1Bean p1= new P1Bean();
p1.setCell(1);
p1.setCellPosition(2);
p1.setCode("A");
s.save(p1);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months
[Hibernate-JIRA] Created: (HHH-5002) testQuery in org.hibernate.test.legacy.FooBarTest errors running with Ingres dialect
by Ray Fan (JIRA)
testQuery in org.hibernate.test.legacy.FooBarTest errors running with Ingres dialect
------------------------------------------------------------------------------------
Key: HHH-5002
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5002
Project: Hibernate Core
Issue Type: Bug
Components: query-sql, testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), IngresDialect
Reporter: Ray Fan
Attachments: legacy.FooBarTest.zip
testQuery in org.hibernate.test.legacy.FooBarTest errors with an exception whilst using IngresDialect
{noformat}
<error message="could not execute query" type="org.hibernate.exception.GenericJDBCException">org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2276)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:936)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.test.legacy.FooBarTest.testQuery(FooBarTest.java:388)
Caused by: com.ingres.gcf.util.SqlEx: An internal error prevents further processing of this query.
Associated error messages which provide more detailed information about the problem can be found in the error log, II_CONFIG:errlog.log
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.RsltFtch.preLoad(Unknown Source)
at com.ingres.gcf.jdbc.RsltCurs.preLoad(Unknown Source)
at com.ingres.gcf.jdbc.RsltCurs.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.exec(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.executeQuery(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1832)
at org.hibernate.loader.Loader.doQuery(Loader.java:719)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2273)
... 37 more
</error>
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months
[Hibernate-JIRA] Created: (HV-508) DecimalMaxValidatorForNumber for a double values is not correct
by Donigiewicz (JIRA)
DecimalMaxValidatorForNumber for a double values is not correct
---------------------------------------------------------------
Key: HV-508
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-508
Project: Hibernate Validator
Issue Type: Bug
Components: validators
Affects Versions: 4.2.0.Final
Environment: hibernate-validator-4.2.0.Final.jar
validation-api-1.0.0.GA.jar
database independent
Reporter: Donigiewicz
Hi ,
In our project we are about to update a validation library from 4.1.CR1 version to 4.2.Final.
Update to 4.1 is not an option for us due to some other problems.
Unfortunately we have encountered that atleast DecimalMax constraint is not working as it was in former version
See the example below
A bean
{code}
public class SpecificBean extends Bean {
private Double doubleTrouble;
@DecimalMax("1.2")
public Double getDoubleTrouble() {
return doubleTrouble;
}
public void setDoubleTrouble(Double doubleTrouble) {
this.doubleTrouble = doubleTrouble;
}
public String getQualifier() {
return "qualifier";
}
}
{code}
And a simple testing class
{code}
public class ValidatorCheck {
/**
* @param args
*/
public static void main(String[] args) {
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
SpecificBean bean2 = new SpecificBean();
bean2.setDoubleTrouble(Double.valueOf(1.0));
Set<ConstraintViolation<SpecificBean>> viols2 = validator.validate(bean2);
checkIfNoViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(1.1));
viols2 = validator.validate(bean2);
checkIfNoViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(1.19));
viols2 = validator.validate(bean2);
checkIfNoViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(1.20));
viols2 = validator.validate(bean2);
checkIfNoViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(1.21));
viols2 = validator.validate(bean2);
checkIfViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(1.3));
viols2 = validator.validate(bean2);
checkIfViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(1.51));
viols2 = validator.validate(bean2);
checkIfViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(1.9));
viols2 = validator.validate(bean2);
checkIfViolation(viols2);
bean2.setDoubleTrouble(Double.valueOf(2.000000001));
viols2 = validator.validate(bean2);
checkIfViolation(viols2);
}
private static void checkIfNoViolation(
Set<ConstraintViolation<SpecificBean>> viols2) {
Assert.assertTrue(viols2.isEmpty());
}
private static void checkIfViolation(
Set<ConstraintViolation<SpecificBean>> viols2) {
Assert.assertFalse("Expected violations ",viols2.isEmpty());
}
}
{code}
It is obvious if you see in the DecimalMaxValidatorForNumber
{code}
public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) {
//null values are valid
if ( value == null ) {
return true;
}
if ( value instanceof BigDecimal ) {
return ( ( BigDecimal ) value ).compareTo( maxValue ) != 1;
}
else if ( value instanceof BigInteger ) {
return ( new BigDecimal( ( BigInteger ) value ) ).compareTo( maxValue ) != 1;
}
else {
return ( BigDecimal.valueOf( value.longValue() ).compareTo( maxValue ) ) != 1;
}
}
{code}
I'm suspecting the cause of this is a https://issues.apache.org/jira/browse/BVAL-15
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months
[Hibernate-JIRA] Created: (HHH-6469) build error when using open jdk
by Strong Liu (JIRA)
build error when using open jdk
-------------------------------
Key: HHH-6469
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6469
Project: Hibernate Core
Issue Type: Bug
Components: build
Affects Versions: 4.0.0.Beta4
Reporter: Strong Liu
Assignee: Hardy Ferentschik
[ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
[ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
[ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
[ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
[ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
:hibernate-core:generateMainLoggingClasses
:hibernate-core:jaxb
[ant:xjc] [ERROR] Both jaxb:version and version are present
[ant:xjc] line 5 of file:/home/stliu/projects/hibernate-core/hibernate-core/src/main/xjb/hbm-configuration-bindings.xjb
[ant:xjc]
FAILURE: Build failed with an exception.
* Where:
Build file '/home/stliu/projects/hibernate-core/hibernate-core/hibernate-core.gradle' line: 77
* What went wrong:
Execution failed for task ':hibernate-core:jaxb'.
Cause: unable to parse the schema. Error messages should have been provided
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 27.285 secs
[stliu@stliu-rhel hibernate-core]$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.8) (rhel-1.39.1.9.8.el6_1-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
[stliu@stliu-rhel hibernate-core]$
---------------------------------------------------------------------
Hardy, i'm assigning this to you since i think you know this better, but feel free re-assign this
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months
[Hibernate-JIRA] Created: (HHH-6464) ElementCollection not updated when using session.update
by Edmondo Porcu (JIRA)
ElementCollection not updated when using session.update
-------------------------------------------------------
Key: HHH-6464
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6464
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.4
Environment: 3.5.4-Final on MYSQL 5.1
Reporter: Edmondo Porcu
When having an entity with an @ElementCollection inside and an Ordinal column, calling session.update(entity) does not update the ElementCollection .
This is my entity:
@Column(nullable=true)
@OrderColumn(name="Ordinal")
@JoinTable(name= "tenor1dcurve_oislist",joinColumns=@JoinColumn(name = "Tenor1DCurve_curveName"))
@Fetch(value = FetchMode.SELECT)
@ElementCollection(fetch = FetchType.EAGER)
private List<CurveInstrument> oisList;
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months