[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2448?page=c...
]
Loïc LEFEVRE updated HHH-2448:
------------------------------
Attachment: report_03.txt
Okay after some more investigation, I can say that columns aliases are mainly compound
of:
-1- the first letters -- including the '_' character or not (depends upon the
version, commented right now) --
of the column: if column.name = TOTO_OID keep only TOTO_ or TOTO so that the length of
"TOTO" + uniqueInteger + "_" is 10 chars long
-2- the unique integer of the table the column belong to + a trailing '_' (the
unique integer of the table is generated in the constuctor
of the org.hibernate.mapping.Table class and depends of the mapping loading *order*
Whereas the attachment report_1.txt shows differences in columns aliases naming regarding
the column unique integer, we decided to
load all the mappings at application starting so now the first unique integer
"bug" is corrected.
However we then encountered problems regarding the table unique number (see report_3.txt).
And since this is caused by mapping load ordering,
I checked our java code doing this job and found we first load all the mapping filenames
in a HashSet and then we iterate on this to load all
mappings using org.hibernate.cfg.Configuration.addClass() and I'm sure the HashSet is
the cause of our problems. If I use a TreeSet, then the
(same) mappings will be loaded in the same order on any application server instance of our
cluster.
It seems these choices will (theoretically) prevent our problems but we'll try before
saying so.
By the way, this can lead to a warning regarding mapping best practices in a cluster
environment.
Regards,
Loïc
Generate identical column aliases among cluster
-----------------------------------------------
Key: HHH-2448
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2448
Project: Hibernate3
Issue Type: Improvement
Components: query-criteria, query-hql
Affects Versions: 3.2.2
Environment: Hibernate version: 3.2.2, 2.1.8
Database: Oracle 9.2.0.8
Reporter: Loïc LEFEVRE
Attachments: report_03.txt, report_1.txt, report_2.txt
Among our weblogic cluster (12 instances), we can see that a query can have different
column aliases.
Although all seems correct, when regarding database reports like StatsPack or Spotlight
we can see that because of these different aliases, the reports are wrong. Indeed, a
resource consuming query can see its associated report properties (cpu usage, buffer gets,
number of executions...) divided by the number of weblogic instances of our cluster (i.e.
divided by 12) thus preventing us to pinpoint the queries to look at.
On a 3 instances cluster, we can see this report:
REPORT#1: one statement with a poor number of buffer gets/execution is reported splitted
in 3, see the alias generated for column DTO.CREATION_DATE
for example
On a 4 instances cluster, we can see this report:
REPORT#2: one statement responsible of the latch free/cache buffers chains wait events
splitted in 4, note the column alias generated fordeffcashcy0_.BEST_EXPECTED_CY
More than confusing the DBAs about the same query with n different "faces", our
reports don't show us all the queries to look at: indeed, in our "Top 50
queries", a lot of them are duplicates! Also the memory required in the SGA to store
the queries, the execution plan and so on is increased...
Finally, although the column aliases can have up to 30 characters under Oracle, the limit
is set to 10, why?
--
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