[Hibernate-JIRA] Created: (ANN-744) Enumerated Primary Key
by Anthony Patricio (JIRA)
Enumerated Primary Key
----------------------
Key: ANN-744
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-744
Project: Hibernate Annotations
Issue Type: Improvement
Reporter: Anthony Patricio
Priority: Minor
Allow to use something like
@Id
@Enumerated(value = EnumType.STRING)
@Column(name = "tag")
private PrefTag tag;
for the moment we get following exception
14:23:57,326 DEBUG [JDBCExceptionReporter] could not load an entity: [com.actual_systems.iceditor.reproduceerror.PrefEntity#2c6d8085fef280aee3efedaee1e3f4f5e1ecdff3f9f3f4e5edf3aee9e3e5e4e9f4eff2aef0f2e5e6e5f2e5eee3e5aed0f2e5e6d4e1e78080808080808080928080f8f2808eeae1f6e1aeece1eee7aec5eef5ed8080808080808080928080f8f0f48087d3c9d4c5dfc9c4] [select prefentity0_.tag as tag47_0_, prefentity0_.value as value47_0_ from preference prefentity0_ where prefentity0_.tag=?]
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bytea
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1548)
--
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
17 years, 4 months
[Hibernate-JIRA] Commented: (HHH-766) Big Performance problem with setParameterList()
by Jacob Poder Kristensen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-766?page=co... ]
Jacob Poder Kristensen commented on HHH-766:
--------------------------------------------
Even though it might be a bit controversial to use a huge number of constants in the WHERE IN clause, the complexity of the used utility, StringHelper. firstIndexOfChar(String sqlString, String string, int startindex), is unnecessarily high.
With the current implementation, 'sqlString' is scanned for all of the characters in 'string', even if a match is found early:
public static int firstIndexOfChar(String sqlString, String string, int startindex) {
int matchAt = -1;
for ( int i = 0; i < string.length(); i++ ) {
int curMatch = sqlString.indexOf( string.charAt( i ), startindex );
if ( curMatch >= 0 ) {
if ( matchAt == -1 ) { // first time we find match!
matchAt = curMatch;
}
else {
matchAt = Math.min( matchAt, curMatch );
}
}
}
return matchAt;
}
Matching one character at a time from 'sqlString' against all those in 'string', has a much better chance for early exit:
/**
* Starting from <code>startindex</code>, find the first index in <code>sqlString</code>
* where any one of the characters in <code>string</code> matches.
* @param sqlString the String to look in.
* @param string the characters to find one of.
* @param startindex the zero based string index to start looking from.
* @return the index of the first matching character or -1 if not found.
*/
public static int firstIndexOfChar(final String sqlString, final String string, final int startindex) {
final int length = string.length();
final char[] chars = new char[length];
string.getChars(0, length, chars, 0);
for ( int i = startindex; i < sqlString.length(); ++i ) {
char c = sqlString.charAt(i);
for ( int j = 0; j < length; ++j ) {
if(c == chars[j]) {
return i;
}
}
}
return -1;
}
So, even if you are happy with the performance of setParameterList, the above is an improvement to firstIndexOfChar in general.
> Big Performance problem with setParameterList()
> -----------------------------------------------
>
> Key: HHH-766
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-766
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0 final
> Environment: Windows
> Reporter: Teva Lautier
> Assignee: Max Rydahl Andersen
>
> Here is a simple code that test setParameterList() with big arrays :
> int nb=16;
> for (int j = 0; j < 50; j++) {
> idCats = new Integer[nb];
> for (int i = 0; i < idCats.length; i++) {
> idCats[i] = new Integer(i + 1);
> }
> long deb = System.currentTimeMillis();
> SQLQuery query = getSession().createSQLQuery(
> "select {R.*} from Cats R where R.idCat in (:cats) ");
> query.addEntity("R", Cat.class);
>
> query.setParameterList("cats",idCats);
> query.list()
> System.out.println("nb doc:"+nb
> +" time="+(System.currentTimeMillis()-deb));
> nb*=2;
> }
> The table Cats contains only 2 lines!
> This gives this :
> ...
> nb docs:64 time=16
> nb docs:128 time=62
> nb docs:256 time=32
> nb docs:512 time=281
> nb docs:1024 time=609
> nb docs:2048 time=2219
> nb docs:4096 time=8938
> nb docs:8192 time=34140
> And I stop to wait for nb docs=16384 after 6 minutes ! The time is not lineare!
> I saw that it is method SQLQueryParser.substituteParams that takes so much time, not the query.
> I prevent this performance problem by splitting arrays with length nb , and makes nbDoc/nb queries
> I tried with nb=200 and nb=500 and nb=50. The best performance I have is when nb=50
> I tried to use simple hand made statement for this query and it is 3 to 10 faster than with hibernate, and time is lineare
> Good luck.
--
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
17 years, 4 months
[Hibernate-JIRA] Created: (HHH-2932) No ConstraintName when using PostgreSQL (BatchUpdateException instead of PSQLException)
by Florian Rock (JIRA)
No ConstraintName when using PostgreSQL (BatchUpdateException instead of PSQLException)
----------------------------------------------------------------------------------------
Key: HHH-2932
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2932
Project: Hibernate3
Issue Type: Sub-task
Affects Versions: 3.2.2
Environment: Postgres 8.2
Reporter: Florian Rock
Priority: Minor
> When using dialect org.hibernate.dialect.PostgreSQLDialect and a ConstraintViolationException is thrown, getConstraintName() does not get the right constraint name.
> It seems that there is something wrong with the ConstraintNameExtractor.
I still run into this problem.
lets take a look into the PostgresDialect:
------ BOF ------
private static ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() {
public String extractConstraintName(SQLException sqle) {
try {
int sqlState = Integer.valueOf( JDBCExceptionHelper.extractSqlState(sqle)).intValue();
switch (sqlState) {
// CHECK VIOLATION
case 23514: return extractUsingTemplate("violates check constraint \"","\"", sqle.getMessage());
// UNIQUE VIOLATION
case 23505: return extractUsingTemplate("violates unique constraint \"","\"", sqle.getMessage());
// FOREIGN KEY VIOLATION
case 23503: return extractUsingTemplate("violates foreign key constraint \"","\"", sqle.getMessage());
// NOT NULL VIOLATION
case 23502: return extractUsingTemplate("null value in column \"","\" violates not-null constraint", sqle.getMessage());
// TODO: RESTRICT VIOLATION
case 23001: return null;
// ALL OTHER
default: return null;
}
} catch (NumberFormatException nfe) {
return null;
}
}
};
------ EOF ------
My problem ist that sqle is a BatchUpdateException and not the suspected PSQLExpection.
BatchUpdateException message doesn't contain the constraintName!
I sloved that by adding
"SQLException psqle = sqle.getNextException();"
and replace the "sqle.getMesage()" with "psqle.getMessage()"
--
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
17 years, 4 months
[Hibernate-JIRA] Created: (ANN-722) ANN-694 alive: FK circularity error under certain circumstances
by Sven Woltmann (JIRA)
ANN-694 alive: FK circularity error under certain circumstances
---------------------------------------------------------------
Key: ANN-722
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-722
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.1.GA
Environment: core 3.2.6, annotations 3.3.1.GA, entitymanager 3.3.2.GA,
mysql 5
Reporter: Sven Woltmann
Priority: Blocker
Attachments: CircularityTest2.rar
The bug described in ANN-694 still exists in 3.3.1.GA under the following circumstances (see below for further description):
------------------------------------------------------------
@Entity
public class A_PK implements Serializable {
public D d;
@ManyToOne
public D getD() {
return d;
}
public void setD(D d) {
this.d = d;
}
}
------------------------------------------------------------
@Entity
public class A implements Serializable {
private A_PK id;
@EmbeddedId
public A_PK getId() {
return id;
}
public void setId(A_PK id) {
this.id = id;
}
}
------------------------------------------------------------
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class B implements Serializable {
@Id
private int id;
}
------------------------------------------------------------
@Entity
public class C extends B implements Serializable {
}
------------------------------------------------------------
public class D_PK implements Serializable {
private C c;
@ManyToOne
public C getC() {
return c;
}
public void setC(C c) {
this.c = c;
}
}
------------------------------------------------------------
@Entity
public class D implements Serializable {
private D_PK id;
@EmbeddedId
public D_PK getId() {
return id;
}
public void setId(D_PK id) {
this.id = id;
}
}
------------------------------------------------------------
The references are as follows - there are no circularity dependencies:
A --> A_PK --> D --> D_PK --> C --> B
------------------------------------------------------------
Hibernate throws the following exception:
org.hibernate.AnnotationException: Foreign key circularity dependency involving the following tables: D, C, A
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:470)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:304)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:762)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:93)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:61)
at test.DoTest.initTest(DoTest.java:22)
------------------------------------------------------------
When I do any of the following, *no* exception is thrown:
- class A_PK: reference "C" instead of "D" (removing "C" from the dependency chain)
- class A: move annotation from getter to field declaration "private A_PK id"
- class A: replace embedded id "A_PK" by reference to "D" (as in "A_PK")
- class A: rename class to "Z"
- class B: remove "strategy" parameter from "@Inheritance" annotation
- class C: not extending "B" and defining the primary key in "C"
- class C: rename class to "Z"
- class D: move annotation from getter to field declaration "private D_PK id"
- class D: replace embedded id "D_PK" by reference to "C" (as in "D_PK")
Attached you'll find a test case.
--
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
17 years, 4 months
[Hibernate-JIRA] Created: (HBX-832) proxy mapping throws a java.lang.NoClassDefFoundError
by Kai Prünte (JIRA)
proxy mapping throws a java.lang.NoClassDefFoundError
-----------------------------------------------------
Key: HBX-832
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-832
Project: Hibernate Tools
Type: Bug
Components: eclipse
Versions: 3.2beta9, 3.2beta8
Environment: Windows XP, Java 1.5.0_08-b03, Hibernate 3.2.1 GA
Reporter: Kai Prünte
I am wondering why I always get a exception during creating the session factory with the Eclipse plugin. After some tests I changed the mapping from:
<class name="MFSTransportUnitTypeImpl" proxy="MFSTransportUnitType" table="transportunittype" dynamic-update="true" lazy="true">
to
<class name="MFSTransportUnitTypeImpl" table="transportunittype" dynamic-update="true" lazy="true">
Without proxy mapping the plug in works fine, however I need the proxy.
The implementation and interface class are in the same package and directory and within my application it works fine.
So I suppose the plugin can not handle proxy mappings.
The Exception:
!ENTRY org.hibernate.eclipse.console 4 4 2006-11-28 13:22:13.610
!MESSAGE Problems while creating sessionfactory
!SUBENTRY 1 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610
!MESSAGE net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
!STACK 0
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
... 23 more
Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
... 28 more
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610
!MESSAGE net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
!STACK 0
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
... 23 more
Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
... 28 more
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610
!MESSAGE java.lang.reflect.InvocationTargetException: <no message>
!STACK 0
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
... 28 more
Root exception:
java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610
!MESSAGE java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType
!STACK 0
java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
!ENTRY org.eclipse.ui 4 4 2006-11-28 13:22:43.699
!MESSAGE Unhandled event loop exception
!ENTRY org.eclipse.ui 4 0 2006-11-28 13:22:43.699
!MESSAGE java.lang.reflect.InvocationTargetException-->null
!STACK 0
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:68)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:52)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:56)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
... 47 more
Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
... 52 more
--
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
17 years, 4 months
[Hibernate-JIRA] Resolved: (HHH-1567) load fails where get succeeds
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1567?page=c... ]
Gail Badner resolved HHH-1567.
------------------------------
Assignee: Gail Badner
Resolution: Duplicate
> load fails where get succeeds
> -----------------------------
>
> Key: HHH-1567
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1567
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: hibernate 3.1.2 against sysbase 12.5.2 using jconn3 jdbc driver
> Reporter: Paul Lorenz
> Assignee: Gail Badner
>
> I have a POJO which has a column
> protected Case data;
> @Type ( type="serializable" )
> @Basic( fetch=FetchType.EAGER )
> public Case getData ()
> {
> return data;
> }
> public void setData (Case data)
> {
> this.data = data;
> }
> I am iterating over every element in the corresponding database table.
> Session session = HibernateUtil.currentSession();
> SQLQuery query = session.createSQLQuery( "select case_id from wf_case" );
> query.addScalar( "case_id", Hibernate.LONG );
> List<Long> caseList = query.list();
> for ( Long caseId : caseList )
> {
> WfCase wfCase = (WfCase)session.load( WfCase.class, caseId );
> if ( wfCase.getData() == null )
> {
> System.out.println( "IS null: " + caseId );
> }
> session.evict( wfCase );
> }
> when I run this, after running through 1500 or 2000 (this number changes between runs), I start getting null returns from wfCase.getData(). After that point, it _always_ returns null. If I call session.evict( wfCase ) on an wfCase which returned null, I get the following exception.
> Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
> at $Proxy23.evict(Unknown Source)
> at hibernate.test.MilestoneCheck.main(MilestoneCheck.java:64)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
> ... 2 more
> Caused by: java.lang.NoSuchMethodError: com.gblx.improv.fit2flow.engine.WfCase.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;
> at com.gblx.improv.fit2flow.engine.WfCase$$EnhancerByCGLIB$$616ee93d.getHibernateLazyInitializer(<generated>)
> at org.hibernate.event.def.DefaultEvictEventListener.onEvict(DefaultEvictEventListener.java:47)
> at org.hibernate.impl.SessionImpl.fireEvict(SessionImpl.java:965)
> at org.hibernate.impl.SessionImpl.evict(SessionImpl.java:957)
> ... 6 more
> Now, if I change the session.load to session.get, it runs through without any problems. I thought maybe the second level cache provider was to blame, but I switched to using <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> in my cfg file, and I still had the same problem.
> Note, I had the same problem when I wasn't using a serializable type, but was rather just mapping it to a byte[].
--
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
17 years, 4 months
[Hibernate-JIRA] Created: (HHH-3109) JTATransaction : Could not find UserTransaction in JNDI
by Yves Galante (JIRA)
JTATransaction : Could not find UserTransaction in JNDI
--------------------------------------------------------
Key: HHH-3109
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3109
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: Webphere 5.1 - Oracle 9i - JDK 1.4
Reporter: Yves Galante
After update hibernate core from 3.2.5 to 3.2.6, I have this exception.
[2/15/08 11:59:09:113 CET] 6f71f29b JTATransactio E org.hibernate.transaction.JTATransaction Could not find UserTransaction in JNDI
[2/15/08 11:59:09:113 CET] 6f71f29b JTATransactio E org.hibernate.transaction.JTATransaction TRAS0014I: The following exception was logged javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1023)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:934)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1261)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:196)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:137)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:60)
at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:57)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:172)
at org.hibernate.impl.SessionImpl.checkTransactionSynchStatus(SessionImpl.java:1867)
at org.hibernate.impl.SessionImpl.setFlushMode(SessionImpl.java:1287)
My hibernate conf :
--
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
17 years, 4 months