[Hibernate-JIRA] Created: (HHH-2019) Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto
by Dave E Martin (JIRA)
Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto
----------------------------------------------------------------------------------
Key: HHH-2019
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2019
Project: Hibernate3
Type: Improvement
Environment: hibernate / annotations / hibernate.properties
Reporter: Dave E Martin
Priority: Minor
It may occasionally be desirable to programmatically get rid of or override a property value, this is generally allowed for by the .setProperty method, however:
Once hbm2ddl.auto is set to something, there is no way to unset it, or set it to a value which would be equivalent to its being unset (or its undocumented). There is no remove or unset, or deleteProperty, and also setting it to null does not work.
Due to issues such as HHH-2018, it may be necessary to programmatically 'get rid of' hbm2ddl.auto even if the end user (or some other mechanism) has specified a value for it in an external hibernate.properties file (or other method of setting hibernate properties).
--
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, 6 months
[Hibernate-JIRA] Created: (HBX-865) ClassValidator cannot be instantiated while trying to open a new Session
by Christian Laakmann (JIRA)
ClassValidator cannot be instantiated while trying to open a new Session
------------------------------------------------------------------------
Key: HBX-865
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-865
Project: Hibernate Tools
Type: Bug
Versions: 3.2beta9
Environment: Hibernate 3.2, Hibernate Tools 3.2beta9 and most recent Nightly
DB: MSSQL Server 2000 & HSQLDB
Reporter: Christian Laakmann
Attachments: Test.java, hibernate.cfg.xml
When I use the @NotEmpty Validator on a String property, Hibernate Tools is unable to open a new Session because the ClassValidator could not be instantiated.
Workaround was to replace @NotEmpty with @NotNull.
see also: http://forum.hibernate.org/viewtopic.php?p=2339708#2339708
Stack-Trace:
java.lang.IllegalArgumentException: could not instantiate ClassValidator
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:287)
at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312)
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.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107)
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66)
at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37)
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283)
... 16 more
java.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107)
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66)
at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37)
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283)
at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312)
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)
--
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, 6 months
[Hibernate-JIRA] Created: (ANN-612) JavaReflectionManager fails with generic types like MyGenericType<Object[]>
by Aleksei Valikov (JIRA)
JavaReflectionManager fails with generic types like MyGenericType<Object[]>
---------------------------------------------------------------------------
Key: ANN-612
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-612
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.0.ga
Environment: I'm using the latest versions:
Hibernate 3.2.4.ga
Hibernate Entity Manager 3.3.1.ga
Hibernate Commons Annotations 3.0.0.ga
Hibernate Validator 3.0.0.ga
JBoss Archive Browsing 2.0.2.alpha
Reporter: Aleksei Valikov
Attachments: C.java
I have a property of generic type with an array parameter like this one:
public static class J<T> {}
private J<Object[]> e;
@Transient
public J<Object[]> getE() {
return e;
}
public void setE(J<Object[]> e) {
this.e = e;
}
When starting the entity manager, I get the following exception:
javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:258)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.createEntityManagerFactory(AbstractEntityManagerTest.java:85)
at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.setUp(AbstractEntityManagerTest.java:44)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164)
at org.hibernate.annotations.common.reflection.java.JavaXProperty.create(JavaXProperty.java:20)
at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXProperty(JavaReflectionManager.java:117)
at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethodProperties(JavaXClass.java:91)
at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:106)
at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:98)
at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:984)
at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:833)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:645)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:186)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:246)
... 17 more
The following property makes no problem:
private J<Object> f;
@Transient
public J<Object> getF() {
return f;
}
public void setF(J<Object> f) {
this.f = f;
}
So I believe it's the arrayd type which is problematic.
>From the stack trace, I believe the problem is with hibernate-commons-annotations.
I also attach the class that reproduces the problem.
--
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, 6 months
[Hibernate-JIRA] Created: (HHH-2630) Hibernate Dialect is not auto-detected for Sybase ASE and DB2
by Emmanuel Bernard (JIRA)
Hibernate Dialect is not auto-detected for Sybase ASE and DB2
-------------------------------------------------------------
Key: HHH-2630
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2630
Project: Hibernate3
Issue Type: Improvement
Components: metamodel
Affects Versions: 3.2.4.sp1
Reporter: Emmanuel Bernard
Assignee: Emmanuel Bernard
The hibernate auto-detection mechanism was tested with the following Databases. DB2 and Sybase ASE - are not automatically detected.
DB2 v8.0:
javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set for database: DB2/LINUX
NOTE: looks like it will be auto-detected for DB2/NT
Sybase ASE 12.5:
[SettingsFactory] RDBMS: Adaptive Server Enterprise, version: Adaptive Server Enterprise/12.5.3/EBF 13332 ESD#7/P/Linux
Intel/Enterprise Linux/ase1253/1951/32-bit/OPT/Fri Mar 24 00:40:52 2006
16:52:09,234 INFO [SettingsFactory] JDBC driver: jConnect (TM) for JDBC (TM), version: jConnect (TM) for JDBC(TM)/5.5(Build 25827)/P/EBF13045/JDK13/Mon Oct 3 7:31:59 2005
javax.persistence.PersistenceException: org.hibernate.HibernateException:
Hibernate Dialect must be explicitly set for database: Adaptive Server Enterprise
The following were auto-detected:
Oracle 9i:
OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production
[SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.1.0.3.0
[Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
Oracle 10g:
[org.hibernate.cfg.SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 -
Production
[org.hibernate.cfg.SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.1.0.3.0
[org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
MsSQLServer 2005:
[org.hibernate.cfg.SettingsFactory] RDBMS: Microsoft SQL Server, version:9.00.2047
14:25:23,808 INFO [SettingsFactory] JDBC driver: Microsoft SQL Server 2005
JDBC Driver, version: 1.1.1501.101
[Dialect] Using dialect: org.hibernate.dialect.SQLServerDialect
PostgresSQL 8.1:
[SettingsFactory] RDBMS: PostgreSQL, version: 8.2.3
[SettingsFactory] JDBC driver: PostgreSQL Native Driver,version: PostgreSQL 8.2 JDBC3 with SSL (build 504)
[Dialect] Using dialect: org.hibernate.dialect.PostgreSQLDialect
MySQL 5.0:
SettingsFactory] RDBMS: MySQL, version:5.0.27-standard-log
[SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu,
19 Oct 2006) $, $Revision: 5908 $ )
[Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
--
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, 6 months
[Hibernate-JIRA] Created: (HSEARCH-33) batch_size to prevent OutOfMemoryException while inserting many objects
by Stefan (JIRA)
batch_size to prevent OutOfMemoryException while inserting many objects
-----------------------------------------------------------------------
Key: HSEARCH-33
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-33
Project: Hibernate Search
Type: New Feature
Components: engine
Versions: 3.0.0.beta1
Reporter: Stefan
While inserting many objects in a batch the application runs out of memory because the FullTextIndexEventListener for Lucene collects the updates.
This is a tough problem. Today the solution is to apply the work in n transactions rather than 1. Maybe the notion of batch_size at some point to force a "flush" when the queue goes up can help. But it sacrifices the transactional semantic.
hibernate.cfg.xml
<event type="post-insert">
<listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
</event>
Inserting code something like:
Session session = sessionFactory.openSession();
session.setCacheMode(CacheMode.IGNORE);
Transaction tx = session.beginTransaction();
for ( int i=0; i<100000; i++ ) {
Item item = new Item(...);
session.save(item);
if ( i % 100 == 0 ) {
session.flush();
session.clear();
}
}
tx.commit();
session.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
17 years, 6 months
[Hibernate-JIRA] Created: (ANN-495) Provide access to IndexWriter.optimize()
by Emmanuel Bernard (JIRA)
Provide access to IndexWriter.optimize()
----------------------------------------
Key: ANN-495
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-495
Project: Hibernate Annotations
Type: New Feature
Components: lucene
Reporter: Emmanuel Bernard
Fix For: 3.3.0.Alpha1
The problem is not solved "automatically" yet. But here is the reason why.
First of all, the elements are properly deleted, and the index file reflect that as soon as IndexReader.close() is called (which is done by Hibernate Search). However, the files containing the document data are not cleaned.
Basically, to physically delete the elements, you need to optimize() your index, this operation typically takes more time and doing it for every single delete is not appropriate.
I see 4 solutions:
1. let the user access the Directory and call the indexWriter.optimize() method. It works today but it sucks.
2. add an FullTextSession.optimize(Class) method, and the application is responsible for the method trigger. This is the easy solution but put more work on the user. And I'm not happy to push a maintenance API to the Session. Esp since this is more of a SessionFactory like API.
2bis. publish this API through JMX
3. optimize every N operations. It is trivial to add a counter per DirectoryProvider and trigger the optimization. N should be customizable
4. optimize every N seconds. either by setting a timer in an additional thread or wait for the next operation and compare the timestamp
2(bis or not) and 3 are my favorites. It's really 2 or 3 hours of work. If someone is interested, ping me.
--
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, 6 months