[Hibernate-JIRA] Created: (HHH-3132) Event System With Phased Appraoch
by Anirudh Vyas (JIRA)
Event System With Phased Appraoch
---------------------------------
Key: HHH-3132
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3132
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.6
Environment: 3.x
Reporter: Anirudh Vyas
Hibernate currently lacks proper event Delegation model;
Granted it has a hook for listeners and iterates through them to find out which is appropriate or not.
But a better way would be to add "Queuing of events" approach; meaning each event is first queued (for firing) and then Hibernate goes through cycles of phases (it can be internally thought of as a Phase 1 ---> Phase 2 ---> Phase 3 ). and each phase has a queue of events it has to process. A phase can have corresponding listener to process phases and clear the queue of events associated with it ( meaning events set to "fire" in the currently executing phase).
All event creation should be centralized and all events should be queued through a factory. A flexible approach (ideally) would be to allow users to create Custom phases to enhance lifecycle of their own Application using Hibernate's Phase interface.
"Phase implementation " could include usage of Enums, but its not mandatory ( so long as we are worried about back-wards compatibility).
As it is, Hibernate Event system is poorly documented and not very well understood.
What do you guys think ?
--
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
18 years, 1 month
[Hibernate-JIRA] Updated: (HHH-1830) Error during parse query on MS SQL
by Alex Savitsky (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1830?page=c... ]
Alex Savitsky updated HHH-1830:
-------------------------------
Attachment: hibernateBug.zip
There you have it - a test case without Annotations
> Error during parse query on MS SQL
> ----------------------------------
>
> Key: HHH-1830
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1830
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.1.2, 3.2.0.cr2
> Environment: Microsoft SQL Server 2000, Windows XP, JDK 1.5 Update 4
> Reporter: Den Raskovalov
> Priority: Critical
> Attachments: hibernateBug.tar.gz, hibernateBug.zip
>
>
> HQL: select deal, items.dateBegin, client.Title from " + CoreDeal.class.getName() + " deal left join deal.stagesWorkflowInstance.history.items items, " + CoreClient.class.getName() + " client where stageResponsible=:stageResponsible and items.index=maxindex(items) and deal.parent=client and deal.stagesWorkflowInstance.Stage.showOnPersonalPage=1
> It works normally on Oracle, but on MS SQL produces:
> Error: String index out of range: -5
> [java.lang.StringIndexOutOfBoundsException]
> java.lang.String.substring(String.java:1768)
> java.lang.String.substring(String.java:1735)
> org.hibernate.hql.CollectionSubqueryFactory.createCollectionSubquery(CollectionSubqueryFactory.java:32)
> org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:301)
> org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:291)
> org.hibernate.hql.ast.tree.FromElement.toColumns(FromElement.java:377)
> org.hibernate.hql.ast.tree.MethodNode.resolveCollectionProperty(MethodNode.java:115)
> org.hibernate.hql.ast.tree.MethodNode.collectionProperty(MethodNode.java:95)
> org.hibernate.hql.ast.tree.MethodNode.resolve(MethodNode.java:44)
> org.hibernate.hql.ast.HqlSqlWalker.processFunction(HqlSqlWalker.java:844)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.functionCall(HqlSqlBaseWalker.java:2324)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1285)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3521)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1686)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
> org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
> org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:227)
> org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:159)
> org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:110)
> org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
> org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
> org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
> org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
> org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
> org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1612)
> ru.naumen.crm2.bobjects.deal.CoreDealHibernateHandler.listAllDealsWithSortDataByResponsible(CoreDealHibernateHandler.java:109)
> ru.naumen.crm2.ui.tlc.CoreEmployeeTableListController.listMyDealsSorted(CoreEmployeeTableListController.java:70)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-3130) Facility to get the SQLs of prepared statements (same as with show_sql=true) to Statistics
by Timo Rantalaiho (JIRA)
Facility to get the SQLs of prepared statements (same as with show_sql=true) to Statistics
------------------------------------------------------------------------------------------
Key: HHH-3130
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3130
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.6
Reporter: Timo Rantalaiho
Attachments: sqls-to-statistics.patch
Hello! It would be excellent to be able to get the SQL produced by Hibernate operations via the Statistics interface.
For example, we have a complex domain and complex queries and have hit an n-selects problem a couple of times when using lazy loading. By being able to assert the number of queries (which you can already get with Statistics.getPrepareStatementCount()) it's possible to control this automatically with developer tests, but we can make our test assertions a lot better by showing the actual SQL statements in the error message. That way it's typically easy to see from the error message which properties you need to add to the ones fetched in the query.
Currently, you have to resort to setting show_sql = true in the configuration, which is clumsy to do in developer tests. It seems that in AbstractBatcher it is easy enough to pass the same information to Statistics, as demonstrated in the attached patch.
The patch is done against the current trunk (revision 14355, Mon Feb 25 2008).
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-3124) @Embeddable with int field leads to java.sql.SQLException: Field doesn't have a default value for one table per class hirarchy
by Sebastian Baltes (JIRA)
@Embeddable with int field leads to java.sql.SQLException: Field doesn't have a default value for one table per class hirarchy
------------------------------------------------------------------------------------------------------------------------------
Key: HHH-3124
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3124
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6, 3.2.5
Environment: Hibernate 3.2.6
Hibernate Annotations 3.3.0.GA
Hibernate EntityManager 3.3.1.GA
MySQL 5.1
Reporter: Sebastian Baltes
Attachments: log.txt
Given the following class hirarchy:
@Entity class Dummy ...
@Entity class DummyA extends Dummy ...
@Entity class DummyB extends Dummy {
DummyEmbedded embedded;
}
@Embeddable public class DummyEmbedded {
int x;
}
calling
DummyA d = new DummyA();
em.persist(d);
leads to
[SERVER] DEBUG [main] - could not insert: [de.neise.gena.model.persistence.DummyA] [insert into gena_test.Dummy (name, DTYPE, id) values (?, 'DummyA', ?)]
java.sql.SQLException: Field 'embedded_x' doesn't have a default value
and the generated DDL is
CREATE TABLE `dummy` (
`DTYPE` varchar(31) NOT NULL,
`id` bigint(20) NOT NULL,
`embedded_x` int(11) NOT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
embedded_x should habe been DEFAULT NULL instead of NOT NULL, as it is the case if I don't use an embedded object:
@Entity class DummyB extends Dummy {
int x;
}
works, then the DDL is korrekt:
CREATE TABLE `dummy` (
`DTYPE` varchar(31) NOT NULL,
`id` bigint(20) NOT NULL,
`x` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
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
18 years, 1 month
[Hibernate-JIRA] Commented: (HHH-125) SEVERE: ORA-01009: missing mandatory parameter
by Oliver Soul (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-125?page=co... ]
Oliver Soul commented on HHH-125:
---------------------------------
This issue also seems to occur when comments are within the sql statement itself.
Remove the inline comments and the issue goes away.
> SEVERE: ORA-01009: missing mandatory parameter
> ----------------------------------------------
>
> Key: HHH-125
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-125
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0 beta 3
> Environment: Hibernate 3 beta 3, Oracle 9i
> Reporter: Carlos Ramírez
> Assignee: Max Rydahl Andersen
> Attachments: CategoryData.java.zip, CategoryData21.zip
>
>
> SEVERE: ORA-01009: missing mandatory parameter
> This error ocurs when I try to load an object with a many-to-many relationship with itself. This task worked in Hibernate 2.1.7 with and Hibernate 3 beta 3 with Hypersonic but no with Hibernate beta 3 Oracle.
> This is the stack trace:
> INFO: Error performing load command
> org.hibernate.exception.GenericJDBCException: could not load an entity: [CategoryData#5]
> at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
> at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.loadEntity(Loader.java:1180)
> at org.hibernate.loader.EntityLoader.load(EntityLoader.java:135)
> at org.hibernate.loader.EntityLoader.load(EntityLoader.java:121)
> at org.hibernate.persister.BasicEntityPersister.load(BasicEntityPersister.java:2339)
> at org.hibernate.event.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:359)
> at org.hibernate.event.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:340)
> at org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:159)
> at org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:132)
> at org.hibernate.event.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:111)
> at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:737)
> at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:59)
> at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:80)
> at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:115)
> at CategoryData$$EnhancerByCGLIB$$26b33c88.toString(<generated>)
> at java.lang.String.valueOf(String.java:2577)
> at java.io.PrintStream.print(PrintStream.java:616)
> at java.io.PrintStream.println(PrintStream.java:753)
> at CategoryData.getData(CategoryData.java:330)
> at CategoryData.main(CategoryData.java:250)
> Caused by: java.sql.SQLException: ORA-01009: missing mandatory parameter
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1894)
> at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:1199)
> at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:295)
> at org.hibernate.loader.Loader.doQuery(Loader.java:366)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:195)
> at org.hibernate.loader.Loader.loadEntity(Loader.java:1171)
> ... 18 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
18 years, 1 month