[Hibernate-JIRA] Created: (HHH-2228) ant eg fails - bad release notes quick start
by Brian Brooks (JIRA)
ant eg fails - bad release notes quick start
--------------------------------------------
Key: HHH-2228
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2228
Project: Hibernate3
Type: Bug
Components: documentation
Versions: 3.2.0.ga
Environment: hibernate 3.2.0.ga
Microsoft Windows XP [Version 5.1.2600]
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)
Reporter: Brian Brooks
Priority: Minor
The hibernate 3.2.0.ga release notes
http://sourceforge.net/project/shownotes.php?release_id=455849&group_id=4...
read as
Get Up And Running Quick
------------------------
Demo:
(1) copy your JDBC driver to the lib directory
(2) edit etc/hibernate.properties
(3) run "ant eg" or "build eg"
(4) browse the sourcecode in eg/org/hibernate/auction
This directions are incorrect. Below is the ant output if these steps are followed. Also, I had to put junit*.jar and antlr*all*.jar in my ANT_HOME/lib before ant eg would work.
C:\hibernate-3.2>ant eg
Buildfile: build.xml
[taskdef] Could not load definitions from resource clovertasks. It could not b
e found.
eg:
[javac] Compiling 8 source files to C:\hibernate-3.2\build\eg
[javac] C:\hibernate-3.2\eg\org\hibernate\auction\Main.java:10: cannot find
symbol
[javac] symbol : class FetchMode
[javac] location: package org.hibernate
[javac] import org.hibernate.FetchMode;
[javac] ^
[javac] C:\hibernate-3.2\eg\org\hibernate\auction\Main.java:11: cannot find
symbol
[javac] symbol : class FlushMode
[javac] location: package org.hibernate
[javac] import org.hibernate.FlushMode;
[javac] ^
[javac] C:\hibernate-3.2\eg\org\hibernate\auction\Main.java:12: cannot find
symbol
[javac] symbol : class LockMode
[javac] location: package org.hibernate
[javac] import org.hibernate.LockMode;
[javac] ^
....
--
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
14 years, 2 months
[Hibernate-JIRA] Created: (HBX-849) Tools does not insert @Type in POJOs for user types defined in reveng.xml
by Zeljko Trogrlic (JIRA)
Tools does not insert @Type in POJOs for user types defined in reveng.xml
-------------------------------------------------------------------------
Key: HBX-849
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-849
Project: Hibernate Tools
Type: Bug
Components: hbm2java, reverse-engineer
Environment: jboss-seam-1.1.0.GA, MySQL
Reporter: Zeljko Trogrlic
I have created reveng.xml file:
<hibernate-reverse-engineering>
<table
catalog="configuration"
name="userdb_domain_acl">
<column name="enabled" type="com.siemens.msm.model.mapping.BooleanEnumType" exclude="false"/>
</table>
</hibernate-reverse-engineering>
and included it in build.xml:
<jdbcconfiguration propertyfile="build.properties"
packagename="${model.package}"
revengfile="${project.home}/reveng.xml"/>
Generated POJO attribute has proper type, but user type information is missing:
@Column(name = "enabled")
@Length(max = 42)
public Boolean getEnabled() {
....
so Hibernate reports error:
3:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl
13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain]
13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui
javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar(
2)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Annotations should look like this:
@Column(name = "enabled")
@Type(type="booleanEnum")
public Boolean getEnabled() {
...
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-2402) HQL generates inner join when selecting a specific attribute that is linked to another entity
by Peter Mutsaers (JIRA)
HQL generates inner join when selecting a specific attribute that is linked to another entity
---------------------------------------------------------------------------------------------
Key: HHH-2402
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2402
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.2
Environment: Oracle 9i, affects ONLY version 3.2.2, was still working OK in version 3.2.1 and before.
Reporter: Peter Mutsaers
Priority: Critical
Mapping (note the lazy='false', it is essential to cause the problem):
<class name='Currency' lazy='false'>
....
</class>
<class name='Asset'>
<id name='id' ... </id>
<many-to-one name='currency' class='Currency' fetch='select'/>
</class>
The following HQL query: "select a.id, a.currency from Asset a"
used to generate a query on the Asset table, and subsequently generates separate queries on the Currency table.
Since version 3.2.2, this generates an inner join on Asset with Currency.
Now many Assets may have a NULL currency, so we do not get all records anymore!
This breaks logic and queries all over the place for us.
We can't go back to 3.2.1 due to other bugs that had been solved in 3.2.2.
The query "from Asset a" still works OK and as before, i.e. it makes the select only on the Asset table and afterwards fetches the Currency with individual selects.
I fear that an optimization has been made that has this negative side effect.
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-2426) Misleading logging messages when using ThreadLocalSessionContext
by Don Smith (JIRA)
Misleading logging messages when using ThreadLocalSessionContext
----------------------------------------------------------------
Key: HHH-2426
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2426
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.ga
Reporter: Don Smith
Priority: Minor
The log messages printed out by TransactionFactoryFactory and SettingsFactory are misleading when using ThreadLocalSessionContext:
2007-02-09 21:49:58,581 INFO [org.hibernate.transaction.TransactionFactoryFactory:info] Using default transaction strategy (direct JDBC transactions)
2007-02-09 21:49:58,588 INFO [org.hibernate.transaction.TransactionManagerLookupFactory:info] No TransactionManagerLookup Configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2007-02-09 21:49:58,590 INFO [org.hibernate.cfg.SettingsFactory:info] Automatic flush during beforeCompletion(): disabled
2007-02-09 21:49:58,591 INFO [org.hibernate.cfg.SettingsFactory:info] Automatic session close at end of transaction: disabled
This does not indicate that sessions will be closed after commit, which is the behavior when using ThreadLocalSessionContext.
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-2131) SYBASE +select for update is showing deadlock because lock is not working properly
by George Thomas (JIRA)
SYBASE +select for update is showing deadlock because lock is not working properly
----------------------------------------------------------------------------------
Key: HHH-2131
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2131
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Environment: sybaseASE 12.5.03 in solaris +hibernate3.1.3
Reporter: George Thomas
I am connecting to Sybase database from hibernate.I tried setting locks using while selecting rows
1.session.load(class,id,LOCKMODE.UPGRADE)
2.session.lock(obj,LOCKMODE.UPGRADE)
I am attaching a sample code while updating a field in table fund after selecting it.
{
Fund fund = null;
ClientCredential credential = new ClientCredential("testDatabase", fund);
org.hibernate.Session session = SessionFactoryManager.getSessionFactory(credential).getCurrentSession();
Transaction transaction = session.beginTransaction();
log.info("Run by " + Thread.currentThread().getName());
fund = (Fund) session.get(Fund.class, new Short((short)12), LockMode.UPGRADE);
fund.setLegalEntityOrgId(fund.getLegalEntityOrgId()+1);
transaction.commit();
}
my requirement was that i wanted to do a select for update.I should acquire lock on certain rows and do a matching and if concurrent request comes ,it should wait till transaction is over that is lock is released.
When I went through the hibernate code,the hibernate is making static queries in the beginning while loading session factory.Since we are appending the holdlock during execution,the sybase dialect is not appending.
As a work around I tested with native sql with holdlock but when I test concurrent request using threads its bombing.Its throwing LockAcquisitionException.( Your server command (family id #0, process id #3777) encountered a deadlock situation.).can anyone give a solution to this problem???
org.hibernate.exception.LockAcquisitionException: could not update: [com.citco.aexeo.common.dataaccess.domain.Fund#12]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:84)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2223)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2375)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:91)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:233)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
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 org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:107)
at com.satyam.Testing.doTransaction(Testing.java:103)
at com.satyam.MyRunnable.run(MyRunnable.java:13)
at java.lang.Thread.run(Thread.java:568)
Caused by: com.sybase.jdbc2.jdbc.SybSQLException: Your server command (family id #0, process id #3777) encountered a deadlock situation. Please re-run your command.
at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2636)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1996)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:204)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:187)
at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1642)
at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:1625)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java:91)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2205)
... 14 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
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-2691) Insert Into Select command outputs incorrect exception
by John Aylward (JIRA)
Insert Into Select command outputs incorrect exception
------------------------------------------------------
Key: HHH-2691
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2691
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.4.sp1
Environment: Hibernate 3.2.4.sp1 with Annotations 3.3.0 And Validator 3.0.0
MySQL 5.0.42
Reporter: John Aylward
receive following exception:
org.hibernate.QueryException: number of select types did not match those for insert [INSERT INTO ProviderInvoiceLineItem (amount,billingAccount,circuit,description,invoice,type) SELECT pili.amount,pili.billingAccount,pili.circuit,pili.description,:newInvoice,pili.type) FROM com.cicat.bedrock.billing.model.ProviderInvoiceLineItem pili WHERE pili.invoice = :oldInvoice]
exception should be that token ')' is not excepected near "pili.type"
Should not have gotten as far as it did, should have blown up on parsing the HQL
--
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
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-2374) setFetchMode() ignore incorect path
by Baptiste MATHUS (JIRA)
setFetchMode() ignore incorect path
-----------------------------------
Key: HHH-2374
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2374
Project: Hibernate3
Type: Bug
Versions: 3.2.0.ga
Environment: All DB I guess
Reporter: Baptiste MATHUS
This bug report is in fact a copy of the one that was already present in H2 : http://opensource.atlassian.com/projects/hibernate/browse/HB-763 . It does not seem to have changed in H3.
When calling setFetchMode("path", FetchMode.JOIN) on a criteria, even if the path is not correct, Hibernate does not complain. Its behaviour seems to be to simply ignore this bad path. I guess this should throw an exception. In fact, the bad thing of ignoring bad path is that if the developer was wrong specifying the path (typo, for example), then the join simply won't happen :-/.
I wrote a very simple testcase :
public void testFindClients()
{
Session session = HibernateUtil.currentSession();
session.beginTransaction();
Client c = (Client)session.createCriteria(Client.class).setFetchMode("foo", FetchMode.JOIN)
.setFetchMode("foo.bar", FetchMode.JOIN).uniqueResult();
session.getTransaction().commit();
}
My Client class has some relationships with other classes, but obviously none named "foo". The code above just issue the following select :
select
this_.ID as ID0_0_,
this_.nom as nom0_0_,
this_.prenom as prenom0_0_,
this_.age as age0_0_
from
Client this_
Thanks again for your great work, guys!
--
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
14 years, 4 months