[Hibernate-JIRA] Created: (HHH-2674) Query using Escape syntax in LIKE expression with PostgresSQL 8.2 results in PSQLException: The column index is out of range
by Shelly McGowan (JIRA)
Query using Escape syntax in LIKE expression with PostgresSQL 8.2 results in PSQLException: The column index is out of range
-----------------------------------------------------------------------------------------------------------------------------
Key: HHH-2674
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2674
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: JBEAP RC6 - 3.2.4.SP1_CP01
Reporter: Shelly McGowan
JPQL:
createQuery(
"select distinct Object(c) FROM Customer c, in(c.aliases) a WHERE a.alias LIKE 'sh\\_ll' escape '\\'")
.setMaxResults(NUMOFCUSTOMERS)
.getResultList();
HIBERNATE: select distinct customer0_.ID as ID3_, customer0_.NAME as NAME3_, customer0_.country as country3_, customer0_.code as code3_, customer0_.FK6_FOR_CUSTOMER_TABLE as FK5_3_, customer0_.FK5_FOR_CUSTOMER_TABLE as FK6_3_ from CUSTOMER_TABLE customer0_ inner join FKS_ALIAS_CUSTOMER aliases1_ on customer0_.ID=aliases1_.FK_FOR_CUSTOMER_TABLE inner join ALIAS_TABLE alias2_ on aliases1_.FK_FOR_ALIAS_TABLE=alias2_.ID where alias2_.ALIAS like 'sh\_ll' escape '\' limit ?
ERROR: javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not execute query
.
.
.
Caused by: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:52)
at org.postgresql.core.v3.SimpleParameterList.setLiteralParameter(SimpleParameterList.java:113)
at org.postgresql.jdbc2.AbstractJdbc2Statement.bindLiteral(AbstractJdbc2Statement.java:2106)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setInt(AbstractJdbc2Statement.java:1151)
at org.hibernate.loader.Loader.bindLimitParameters(Loader.java:1646)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1566)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
--
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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-2586) Hibernate Serializable classes do not declare serialVersionUID
by Manuel Dominguez Sarmiento (JIRA)
Hibernate Serializable classes do not declare serialVersionUID
--------------------------------------------------------------
Key: HHH-2586
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2586
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.2.0.cr5, 3.2.0.cr4, 3.2.0.cr3, 3.2.0.cr2, 3.2.0 cr1, 3.1.3, 3.2.0.alpha2, 3.2.0.alpha1, 3.1.2, 3.1.1, 3.1, 3.1 rc3, 3.1 rc2, 3.1 rc 1, 3.1 beta 2, 3.1 beta 1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0 final, 3.0 rc 1, 3.0 beta 4, 3.0 beta 3, 3.0 beta 2, 3.0 beta 1, 3.0 alpha
Environment: Not specific to any database, platform or Hibernate version.
Reporter: Manuel Dominguez Sarmiento
None of the Serializable classes in Hibernate declare serialVersionUID (see http://www.hibernate.org/hib_docs/v3/api/serialized-form.html#org.hiberna...).
This is recommended practice for ALL classes that implement the Serializable interface (see Joshua Bloch's Effective Java - Item #54). Adding these fields is trivial and takes little effort, but is a great enhancement if you are serializing Hibernate classes.
For instance, we upgraded from Hibernate 3.2.2 to 3.2.3 in our production servers. We serialize process state (which sometimes includes references to Hibernate-managed entities) every 30 seconds or so and on shutdown, so in the event of failures or re-deployment, the processes can continue where they left off. We had a huge surprise when deserialization failed completely because AbstractPersistentCollection had slightly changed between the 3.2.2 and 3.2.3 releases, and this caused the automatically-generated default serialVersionUID to change, even though the changes in the serialized form are compatible as far as we can tell.
--
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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-2723) Problem manipulating CLOB column Oracle 10G
by Priya Venkatesan (JIRA)
Problem manipulating CLOB column Oracle 10G
-------------------------------------------
Key: HHH-2723
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2723
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.1
Reporter: Priya Venkatesan
When trying to insert successive records with CLOB column throws java.sql.BatchUpdateException: ORA-01400: cannot insert NULL error.
Steps to reproduce:
1.Create a object with CLOB mapped to string dataType
2.Set CLOB value (any value > 4000 chars)
3.Call session.save on the object
4.Create another object and do not set the CLOB column value.
5.Call session.save on the object.
--> Returns error
Hibernate: insert into JXPTEST (name, cost, thingSize, type, lastupdate, lockToken, id2, longField, booleanField, doubleField, clobField, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.StringType - binding 'name' to parameter: 1
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.BigDecimalType - binding '999' to parameter: 2
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.IntegerType - binding '1' to parameter: 3
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.StringType - binding 'gold' to parameter: 4
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.DateType - binding '04 July 2007' to parameter: 5
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.StringType - binding '4c22dc2f138e21f301139253d0a700f9' to parameter: 6
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.StringType - binding null to parameter: 7
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.LongType - binding null to parameter: 8
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.BooleanType - binding null to parameter: 9
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.DoubleType - binding null to parameter: 10
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.StringType - binding null to parameter: 11
2007-07-04 10:42:52,855 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.type.StringType - binding '4c22dc2f138e21f301139253d0a700fa' to parameter: 12
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
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 com.chordiant.persistence.HibernateDataAccess.createPoint(HibernateDataAccess.java:251)
at com.chordiant.persistence.HibernateDataAccess.createSet(HibernateDataAccess.java:266)
at com.chordiant.persistence.SQLDataAccess.createSet(SQLDataAccess.java:1149)
at com.chordiant.persistence.test.JXPTestService.createSet(JXPTestService.java:263)
at com.chordiant.persistence.test.JXPTestService.processRequest(JXPTestService.java:581)
at com.chordiant.service.MasterStatelessServiceBean.processRequest(MasterStatelessServiceBean.java:535)
at com.chordiant.service.GatewayHandler.processRequest(GatewayHandler.java:266)
at com.chordiant.service.ejb.EJBGatewayServiceBean.processRequestObject(EJBGatewayServiceBean.java:171)
at com.chordiant.service.ejb.EJBGatewayServiceCMT_p5ylky_EOImpl.processRequestObject(EJBGatewayServiceCMT_p5ylky_EOImpl.java:132)
at com.chordiant.service.ejb.EJBGatewayServiceCMT_p5ylky_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("CCSOWNER"."JXPTEST"."ID")
----------------------------------------------------------------------------------------------------------------------------
Following is my hibernate mapping file
hibernate-mapping>
<class name="com.chordiant.persistence.test.Thing" table="JXPTEST" lazy="false">
<id name="Id" column="ID" type="string">
<generator class="uuid.hex">
</generator>
</id>
<property name="nameOfAnItemThatHasToBeThisLongToTestTheOperationalBehavior" type="string" column="name" length="80" not-null="true" lazy="false"/>
<property name="cost" type="big_decimal" precision="8" scale="2" not-null="false" lazy="false"/>
<property name="size" type="int" column="thingSize" length="10" not-null="false" lazy="false"/>
<property name="type" type="string" column="type" length="80" not-null="true" lazy="false"/>
<property name="lastUpdate" type="date" column="lastupdate" not-null="false" lazy="false"/>
<property name="lockToken" type="string" column="lockToken" length="128" not-null="false" lazy="false"/>
<property name="id2" type="string" column="id2" length="80" not-null="false" lazy="false"/>
<property name="longField" type="long" column="longField" length="22" not-null="false" lazy="false"/>
<property name="booleanField" type="boolean" column="booleanField" length="1" not-null="false" lazy="false"/>
<property name="doubleField" type="java.lang.Double" column="doubleField" precision="8" scale="2" not-null="false" lazy="false"/>
<property name="clobField" type="string" column="clobField" length="128" not-null="false" lazy="false"/>
</class>
</hibernate-mapping>
--
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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-2477) lazy fetching ManyToOne produces inproper proxies when using single table inheritance strategy
by Daniel Nguyen (JIRA)
lazy fetching ManyToOne produces inproper proxies when using single table inheritance strategy
----------------------------------------------------------------------------------------------
Key: HHH-2477
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2477
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1
Environment: hibernate 3.2.1-GA, postgresql 8.1
Reporter: Daniel Nguyen
Attachments: bug.zip
I have entity base class Vehicle and entity class Car which extends Vehicle (using single table inheritance strategy).
I also have entity class User which have single-ended @ManyToOne relation from User to Vehicle with lazy fetching.
Now there is a Car instance "c" and User instance "u" with relation to "c". Lazily fetching vehicle from "u" results with proxy object "o" which is instanceof Vehicle but not instanceof Car as expected. So it's impossible cast "o" to Car or at least read any of Car's property from "o".
This is serious problem when inheritance is extensively used because inproper proxy object remains in cache. To walkaround I'd have to resign with lazy fetching (much performance loss) or manually replace proxy object in cache.
testing code:
SessionFactory sf = null;
Session s = null;
Transaction tx = null;
try
{
sf = cfg.buildSessionFactory();
s = sf.openSession();
tx = s.beginTransaction();
//create car
Car car = new Car();
car.setIdVehicle(1);
car.setAge(5);
s.save(car);
//create user of car
User user = new User();
user.setIdUser(1);
user.setVehicle(car);
s.save(user);
//make sure it is actually added
s.flush();
// test 1 - works ok, because we loaded vehicle before user
s.clear(); //clear cache
Vehicle vv = (Vehicle)s.get(Vehicle.class, 1);
User uu = (User)s.get(User.class, 1);
//we know that user vehicle is actually a Car
Car cc = (Car)uu.getVehicle();
// test 2 - fails, when using lazy fetching
s.clear(); //clear cache
User u = (User)s.get(User.class, 1);
Vehicle v = u.getVehicle();
//we know that user vehicle is actually a Car
//so we cast to Car but ClassCastException is raised!!!
Car c = (Car)v;
//let's check what's actual class of v
System.out.println(v.getClass().getName());
System.out.println(v.getClass().getSuperclass().getName());
//result:
// test.hibernate.Vehicle$$EnhancerByCGLIB$$12ce1883
// test.hibernate.Vehicle
//but I expected:
// test.hibernate.Car$$EnhancerByCGLIB$$xxxxx
// test.hibernate.Car
}
finally
{
if (tx!=null)
tx.rollback();
if (s!=null)
s.close();
if (sf!=null)
sf.close();
}
--
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
16 years, 4 months