[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
[Hibernate-JIRA] Created: (HHH-2442) ClassCastException loading from second level cache
by Marcio Moraes (JIRA)
ClassCastException loading from second level cache
--------------------------------------------------
Key: HHH-2442
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2442
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1, 3.2.2, 3.2.0.ga
Environment: Linux 2.6.15-27-686 #1 SMP PREEMPT Fri Dec 8 18:00:07 UTC 2006 i686 GNU/Linux
Reporter: Marcio Moraes
Priority: Blocker
I'm getting a error when using hibernate 3.2.2.ga with cache (JBoss-Cache) cluster.
When hibernate get a entity from second level cache it confuses the arrays of values against array of types.
So in some situations i got ClassCastException ...
Looking up CacheEntry code at assemble method i saw:
private static Object[] assemble(
final Serializable[] values,
final Object result,
final Serializable id,
final EntityPersister persister,
final Interceptor interceptor,
final EventSource session)
throws HibernateException {
//assembled state gets put in a new array (we read from cache by value!)
Object[] assembledProps = TypeFactory.assemble(
values,
persister.getPropertyTypes(),
session, result
);
The issue is values (Serializeble[]) is in wrong order compared with persister.getPropertyTypes() (Type[]).
If only one cache instance is running it doesnt occurs ...
I am using Linux.
Att,
Márcio Moraes
--
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: (HBX-954) Failing detection of Sequences?
by Vincent Latombe (JIRA)
Failing detection of Sequences?
-------------------------------
Key: HBX-954
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-954
Project: Hibernate Tools
Issue Type: Bug
Environment: Hibernate3 as provided by Seam 1.2.1GA (dunno which subversion)
Oracle 10g
Reporter: Vincent Latombe
Here is my problem : I used reverse engineering to get an entity from a table in a database.
I got my entity then I wanted to add a generation for the Id. Fine, I add HIBERNATE_SEQUENCE which is needed then I add the annotation to my entity.
I get this :
@Id
@Column(name = "ID", precision = 22, scale = 0)
@GeneratedValue(strategy=GenerationType.SEQUENCE)
@NotNull
public long getId() {
return this.id;
}
Nothing really difficult. Then I try to deploy my ejb using the validate strategy of hbm2ddl. And it fails because it can't find the sequence ([DatabaseMetadata] table not found: TESTSEAM.hibernate_sequence)... Ok strange. Then I switch to the update strategy... Now I get something interesting.
14:40:12,843 INFO [DatabaseMetadata] table not found: TESTSEAM.hibernate_sequence
14:40:12,843 INFO [DatabaseMetadata] table not found: hibernate_sequence
14:40:12,875 ERROR [SchemaUpdate] Unsuccessful: create sequence TESTSEAM.hibernate_sequence
14:40:12,875 ERROR [SchemaUpdate] ORA-00955: ce nom d'objet existe dÚjÓ
14:40:12,875 INFO [SchemaUpdate] schema update complete
It seems that DatabaseMetadata try to lookup a table instead of a sequence, so it can't detect the already existing sequence. So then it tries to create the sequence but it already exists. Any clue?
--
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