[Hibernate-JIRA] Created: (HHH-2587) There is an attempt to set more parameters on a prepared statement than the latter can hold
by Zied Hamdi (JIRA)
There is an attempt to set more parameters on a prepared statement than the latter can hold
-------------------------------------------------------------------------------------------
Key: HHH-2587
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2587
Project: Hibernate3
Issue Type: Bug
Components: query-sql
Affects Versions: 3.2.3
Environment: JPA through hibernate
Reporter: Zied Hamdi
Priority: Blocker
Attachments: IntoCore.zip
You can directly import the zip content into netBeans 5.5 the just launch: the test is executed at the home page servlet call.
I have an index that doesn't exist : 11 (the total count of columns is 10) :
Hibernate: insert into BasicPersonArchiveEntry (endDate, entryPerformer_revision, entryPerformer_id, lastOccurence, note, startDate, source_revision, source_id, revision, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
could not bind value '0' to parameter: 11; Invalid argument: parameter index 11 is out of range.
SQL Error: -99999, SQLState: null
Invalid argument: parameter index 11 is out of range.
Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [com.homeservices.model.impl.BasicPersonArchiveEntry]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
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:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:516)
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:395)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
at $Proxy49.create(Unknown Source)
at tests.entities.TestArchiveServlet.processRequest(TestArchiveServlet.java:46)
at tests.entities.TestArchiveServlet.doGet(TestArchiveServlet.java:61)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: org.apache.derby.client.am.SqlException: Invalid argument: parameter index 11 is out of range.
at org.apache.derby.client.am.PreparedStatement.checkForValidParameterIndex(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.checkSetterPreconditions(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.setLong(Unknown Source)
at org.hibernate.type.LongType.set(LongType.java:42)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:116)
at org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:284)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2008)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2243)
... 46 more
EJB5018: An exception was thrown during an ejb invocation on [ArchivableFacadeStatelessBean]
javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
--
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
15 years
[Hibernate-JIRA] Created: (HSEARCH-701) Avoid reflection used for debugging purposes during query results processing
by Sanne Grinovero (JIRA)
Avoid reflection used for debugging purposes during query results processing
----------------------------------------------------------------------------
Key: HSEARCH-701
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-701
Project: Hibernate Search
Issue Type: Improvement
Reporter: Sanne Grinovero
Fix For: 3.4.0.Beta1
In methods:
org.hibernate.search.engine.DocumentBuilderHelper.processFieldsForProjection(PropertiesMetadata, String[], Object[], Document, ContextualException2WayBridge)
org.hibernate.search.engine.DocumentBuilderHelper.getDocumentFields(SearchFactoryImplementor, Class<?>, Document, String[])
the ContextualException2WayBridge is used to provide nice error messages, but pushMethod of this helper requires a String, while the objects being passed are Method.getName() (which also returns a String).
It seems that performing these getName() provides a performance penalty, we should see if it's not possible to invoke the method only in case an error is actually thrown.
Better alternative - as the getName() was also an issue in other points - is to improve the getName() implementation to define this as a constant field;
--
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
15 years
[Hibernate-JIRA] Created: (HBX-1179) <one-to-one> should not generate Sets
by Joachim Durchholz (JIRA)
<one-to-one> should not generate Sets
-------------------------------------
Key: HBX-1179
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1179
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Environment: Hibernate Tools version as reported by Eclipse: 3.3.0.v20101016-0359-H111-Beta1
Feel free to identify the matching release numbers, I can't :-/
Reporter: Joachim Durchholz
Hibernate tools does not always recognize one-to-one associations as such, even if specified as <one-to-one> in hibernate.reveng.xml.
1. It should generally not silently fall back to one-to-many or many-to-one if it determines that one-to-one is not possible; it should report an error instead. (This allows programmers to correct the database and/or the hibernate.reveng.xml: if it's really a one-to-many, they can move the association to the other table and make it many-to-one; if it should be one-to-one, they can add the missing constraints, giving Hibernate better information about the database schema actually in place.)
2. In the following test case, it does not recognize the relationship as one-to-one even though it is, erroneously generating a Set for the <inverse-one-to-one> direction instead of a backlink.
Workarounds:
A) Use <inverse-one-to-one exclude="true"/> to prevent Set creation. Works if you don't need the backlink.
B) Have a backlink field in the target table. Create two one-to-one associations, one for each direction, and use <inverse-one-to-one exclude="true"/>.
C) Do not reverse engineer the one-to-one association at all and use Criteria, HQL, or SQL to navigate the link.
D) Subclass DefaultReverseEngineeringStrategy and override isOneToOne() for that particular association.
Test case:
Table creation (Oracle 10g)
CREATE TABLE "HF_DI_BVKRIT" (
"BKID" NUMBER(27,0) NOT NULL ENABLE,
"VERSION" NUMBER(18,0) DEFAULT 0 NOT NULL ENABLE,
"BKNAME" VARCHAR2(40) NOT NULL ENABLE
) ;
ALTER TABLE "HF_DI_BVKRIT" ADD CONSTRAINT "HF_DI_BVKRIT_PK"
PRIMARY KEY ("BKID") ENABLE;
CREATE TABLE "HF_DI_BVKOPF" (
"BVID" NUMBER(10,0) NOT NULL ENABLE,
"VERSION" NUMBER(18,0) DEFAULT 0 NOT NULL ENABLE,
"BVBKID" NUMBER(27,0) NOT NULL ENABLE,
"BVGPRS" NUMBER(8,2)
) ;
ALTER TABLE "HF_DI_BVKOPF" ADD CONSTRAINT "HF_DI_BVKOPF_PK"
PRIMARY KEY ("BVID") ENABLE;
ALTER TABLE "HF_DI_BVKOPF" ADD CONSTRAINT "HF_DI_BVKOPF_UK"
UNIQUE ("BVBKID") ENABLE;
ALTER TABLE "HF_DI_BVKOPF" ADD CONSTRAINT "HF_DI_BVKOPF_FK_BVKRIT"
FOREIGN KEY ("BVBKID") REFERENCES "HF_DI_BVKRIT" ("BKID") ENABLE;
Relevant hibernate.reveng.xml section:
<table name="HF_DI_BVKOPF">
<column name="VERSION" type="long"></column>
<foreign-key constraint-name="HF_DI_BVKOPF_FK_BVKRIT">
<one-to-one />
<inverse-one-to-one />
</foreign-key>
</table>
Generated Java classes:
public class HfDiBvkrit implements java.io.Serializable {
private BigInteger bkid;
private long version;
private String bkname;
private Set <HfDiBvkopf> hfDiBvkopfs = new HashSet <HfDiBvkopf> (0);
// The above line should have been generated as:
// private HfDiBvkopf hfDiBvkopf;
...
}
public class HfDiBvkopf implements java.io.Serializable {
private BigInteger bvid;
private long version;
private HfDiBvkrit hfDiBvkrit;
private BigDecimal bvgprs;
...
}
Reasoning why this should be a one-to-one association (hopefully I didn't make too many errors reversing the roles of left and right table):
There is a unique key on BVKOPF.BVBKID.
I.e. a BVKRIT record can find at most one BVKOPF with a BVBKID that matches its BVKRIT.BKID.
The BVKOPF-BVKRIT association hence must be one-to-*. (1)
There is a foreign key from BVKOPF.BVBKID to BVKRIT.BKID.
BKID is a unique key in BVKRIT (it also happens to be the primary key, but that's irrelevant here).
I.e. a BVKOPF record can find at most one BVKRIT with a BKID that matches its BVKOPF.BVBKID.
The BVKOPF-BVKRIT association hence must be *-to-one. (2)
Combining (1) and (2) gives "must be one-to-one", q.e.d.
See also https://forum.hibernate.org/viewtopic.php?f=6&t=1009989&start=0
--
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
15 years
[Hibernate-JIRA] Created: (HV-406) URL Validator not effective
by Marc Schipperheyn (JIRA)
URL Validator not effective
---------------------------
Key: HV-406
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-406
Project: Hibernate Validator
Issue Type: Bug
Affects Versions: 4.1.0.Final
Reporter: Marc Schipperheyn
Assignee: Hardy Ferentschik
Priority: Minor
The supplied URL Validator basically doesn't work. Or at least not as expected.
It creates a URL against the URL class and if it fails this, it returns false. There are multiple problems with this:
* A URL like http://bljdlfghjdlgjlfd is perfectly valid according to the URL class (intranet domains can be anything)
* It's not the most efficient way to test this (generating an error etc)
In order to retain backward compatibility I would suggest adding an "internet" attribute, which would force the validator to really check for minimally one dot, maximum 3 characters in the domain extension, etc. Because that is what you would normally want from a validator like this.
Also, I would not use the URL class, but use a regular expression. A more elegant way to check this.
The URL class approach could be retained for when the "internet" attribute is false
--
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
15 years