[Hibernate-JIRA] Created: (HHH-2223) BatchFetchQueue.getXXXBatch() cache check impeding batch fetching
by Joel Caplin (JIRA)
BatchFetchQueue.getXXXBatch() cache check impeding batch fetching
-----------------------------------------------------------------
Key: HHH-2223
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2223
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.ga
Environment: 3.2.0GA, Mac OS X/Solaris 10, Sybase 12.5/HSQLDB
Reporter: Joel Caplin
Priority: Minor
Attachments: testcase.tar
I have attached a test case which demonstrates the issue at hand by implementing a cheap data model: Pub >---|- Manager -|--< Employee
Pub and Employee are uncached; Manager is cached (tried under both Eh and the non-prod HashMap implementation). All associations are lazy. The test case has a default batch size of 10 and uses hsqldb to demonstrate the problem - which was diagnosed against Sybase.
When BatchFetchQueue.getXXXBatch() is invoked, it does not load any objects it finds in the second level cache - it merely acknowledges their presence by logging to INFO (isCached()). This in turn means that any child associations in that cached object will not have a proxy created for them.
Suppose we want to find all the employees of the pubs in our database. We choose to do this by loading all the Pubs ("FROM Pub") and calling thePub.getManager().getEmployees() iteratively.
When the managers are in the second level cache, Hibernate issues 11 select statements: one to load the pubs and one for each distinct manager.
When the Managers are not in the cache, Hibernate issues 3 select statements: one to load the pubs, one to load the managers and one to load the employees.
A solution might be to load the object from the cache instead of just ignoring it?
--
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
12 years, 1 month
[Hibernate-JIRA] Created: (HHH-2280) Not-Null Constraint-Violation with unidirectional one-to-many mapping
by Robert Herschke (JIRA)
Not-Null Constraint-Violation with unidirectional one-to-many mapping
---------------------------------------------------------------------
Key: HHH-2280
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2280
Project: Hibernate3
Type: Bug
Versions: 3.2.0.cr4
Environment: Hibernate 3.2.0.cr4, Oracle 10XE
Reporter: Robert Herschke
Priority: Blocker
Attachments: one-to-many-test.zip
In some cases it is neccessary to have an unidirectional one-to-many mapping, but not using Join-Tables due to a legacy database system.
So it must be possible, to have a one-to-many mapping just via a foreign-key-mapping. The Child-Object must not know the Parent-Object in this case.
It must also be possible, to pay respect to a NOT-NULL-Constraint at this foreign-key due to restrictions on legacy database systems.
Hibernate doesn't support this, but throw a NOT-NULL-Constraint Violation Exception. The documentation says, "this is unusual" - to which I want to dissent.
See the attached testcase for details, that is adopted from your "one-to-many" testcase found in the 3.2.0 sources.
--
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
12 years, 2 months
[Hibernate-JIRA] Created: (HHH-2697) Can't use := for variable assignment within a SQL-Statement
by Benjamin Gniza (JIRA)
Can't use := for variable assignment within a SQL-Statement
-----------------------------------------------------------
Key: HHH-2697
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2697
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.4.sp1
Environment: MySQL Datasource, Hibernate 3.2.4.sp1
Reporter: Benjamin Gniza
Priority: Minor
i found a kind of bug in org.hibernate.engine.query.ParameterParser.java:
I have an exotic mysql-statement where I want to use mysql variables.
VERY SIMPLE example:
SET @pos=0;
SELECT @pos:=@pos+1 FROM TABLE;
Steps to reproduce:
Session s = sessionFactory.openSession();
s.createSQLQuery("SET @pos=0").executeUpdate();
SQLQuery qry = s.createSQLQuery("select @pos:=@pos from SomeTable");
List lst = qry.list();
Exception:
org.hibernate.QueryException: Space is not allowed after parameter prefix ':' 'SELECT @pos:=@pos+1 FROM TABLE'
at org.hibernate.engine.query.ParameterParser.parse(ParameterParser.java:68)
...
...
Suggested fix:
ParameterParser Lines 62 to 73:
if (c == ':' && (indx + 1 >= stringLength || sqlString.charAt(indx + 1) != '=')) {
// named parameter
int right = StringHelper.firstIndexOfChar( sqlString, ParserHelper.HQL_SEPARATORS, indx + 1 );
int chopLocation = right < 0 ? sqlString.length() : right;
String param = sqlString.substring( indx + 1, chopLocation );
if ( StringHelper.isEmpty( param ) ) {
throw new QueryException("Space is not allowed after parameter prefix ':' '"
+ sqlString + "'");
}
recognizer.namedParameter( param, indx );
indx = chopLocation - 1;
}
--
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
12 years, 2 months
[Hibernate-JIRA] Created: (HHH-2165) Change logging level in TableMetadata from INFO to DEBUG or TRACE
by Igor A Tarasov (JIRA)
Change logging level in TableMetadata from INFO to DEBUG or TRACE
-----------------------------------------------------------------
Key: HHH-2165
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2165
Project: Hibernate3
Type: Improvement
Components: metamodel
Versions: 3.2.0.ga
Reporter: Igor A Tarasov
TableMetadata produce too many output to INFO log level. It good thing if it output be at DEBUG level to not hide other impotant information as service start/stop and other.
20.10.06 18:01:58 INFO [main]: SchemaUpdate - updating schema
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.ChageDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [id, _version, chagedate, created, service, sum, restbalance, comment, customer_id]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, fk8f40c06527214c11, chagedate, primary]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.CustomerDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [phone, firm, group_id, deleted, fio, id, balance, created, updated, address, email, name, comment]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, primary, fk1892e50924b4a799, deleted]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.GroupDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [id, updated, created, name, comment, deleted]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, primary, deleted]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.HostDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [tarif_id, server_id, ips, mac, deleted, id, created, updated, name, lastactive, comment, disabled, customer_id]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [ips, name, primary, fk812f2053f280a3b1, mac, deleted, fk812f205327214c11, fk812f20537f1e2ff9]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.HostSessionDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [id, host_id, starttime, chage, speedou, updatetime, speedin, bytesin, stoptime, bytesou, version]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [fk9a9074b995d39b51, id, primary]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.LoginDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [id, nickname, updated, created, name, comment, password, deleted, customer_id, disabled]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, name, primary, fk77a0599427214c11, deleted]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.PPPAccountDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [tarif_id, login_id, id, server_id, updated, created, comment, deleted, disabled, ip]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, fk507abf087f1e2ff9, primary, fk507abf08f280a3b1, fk507abf08820174d9, deleted]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.PPPSessionDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [callerid, starttime, account_id, updatetime, speedou, chage, speedin, stoptime, bytesou, version, ip, id, ident, bytesin]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, fke19b413144f3fa61, starttime, ident, updatetime, primary, stoptime]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.PaymentDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [id, _version, created, nalichka, sum, paydate, comment, newbalance, customer_id]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, fk7249f0f127214c11, primary, paydate]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.ServerDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [id, updated, created, name, comment, deleted, ip]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, name, primary, deleted, ip]
20.10.06 18:01:58 INFO [main]: TableMetadata - table found: isp.TarifDO
20.10.06 18:01:58 INFO [main]: TableMetadata - columns: [costsizein, resetprepaidsize, prepaidsizerest, moncost, resetprepaidusages, costusage, resetprepaidtime, deleted, prepaidtimemonthly, costtime, prepaidsizemonthly, id, prepaidusagesrest, monthenddate, costsizeou, created, updated, name, prepaidtimerest, prepaidusagesmonthly, comment, customer_id]
20.10.06 18:01:58 INFO [main]: TableMetadata - foreign keys: []
20.10.06 18:01:58 INFO [main]: TableMetadata - indexes: [id, primary, fk7893f6d27214c11, deleted]
20.10.06 18:01:58 INFO [main]: SchemaUpdate - schema update complete
--
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
12 years, 2 months
[Hibernate-JIRA] Created: (ANN-677) Blob is null with Postgresql
by Aaron Luchko (JIRA)
Blob is null with Postgresql
----------------------------
Key: ANN-677
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-677
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.2.1
Environment: hibernate-3.2.1, hibernate-annotations-3.2.1, postgresql-8.2.5-1.fc7, postgresql-jdbc-8.2.504-1jpp.fc7 and postgresql-8.2-506.jdbc4.jar
Reporter: Aaron Luchko
Attachments: hibPostgresbug.zip
I've found that after a sequence of queries, starting new transactions and clearing the session, a Blob will not be successfully from the database and null will be returned by the InputStream instead. Using the debugger I've followed this into the jdbc code and from what I can tell some message is sent to load the blob but the database replies with an empty set of data which naturally causes the InputStream to read null.
I've attached a test case (sorry, no makefile or pom.xml, I just ran it using eclipse) which, for me, replicates the bug.
Note I've also used hsqldb and mysql and didn't see the bug with them, only postgresql.
thanks,
Aaron
--
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
12 years, 2 months
[Hibernate-JIRA] Created: (HBX-978) unique=true attribute of primary key in generated class prevents the schema to be regenerated
by Ali Sadik Kumlali (JIRA)
unique=true attribute of primary key in generated class prevents the schema to be regenerated
---------------------------------------------------------------------------------------------
Key: HBX-978
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-978
Project: Hibernate Tools
Issue Type: Bug
Environment: OS: Windows Vista 6.0,x86
Database: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Java VM: Java HotSpot(TM) Server VM 1.5.0_11-b03,Sun Microsystems Inc.
Eclipse Europa: Version: 3.3.0 Build id: I20070621-1340
HibernateTools-3.2.0.beta10
Reporter: Ali Sadik Kumlali
Priority: Minor
Hi,
When I reverse engineer against Oracle, unique=true attribute is added to @Column annotation of primary key column. But, when I generate schema from these generated files, Oracle throws "ORA-02261: such unique or primary key already exists in the table" error.
I first ran into this situation while trying Seam and posted the problem to Seam's forum: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116478. After I got the response, decided to try it without Seam. Then, downloaded the latest HibernateTools & Eclipse Europa and reverse engineered the schema. I saw that generated classes have unique=true attribute which clearly showed that the problem was related with HibernateTools, not with Seam.
Here is the DDL of the table against which I made my test:
CREATE TABLE PEOPLE ("ID" NUMBER NOT NULL, "SURNAME" VARCHAR2(50 BYTE), "NAME" VARCHAR2(25 BYTE), CONSTRAINT "PEOPLE_PK" PRIMARY KEY ("ID"));
Regards,
Ali Sadik Kumlali
--
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
12 years, 3 months