[Hibernate-JIRA] Created: (HHH-4857) Sharing some of the config info from Ejb3Configuration and SessionFactoryImpl
by Chris Baxter (JIRA)
Sharing some of the config info from Ejb3Configuration and SessionFactoryImpl
-----------------------------------------------------------------------------
Key: HHH-4857
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4857
Project: Hibernate Core
Issue Type: New Feature
Components: core, entity-manager
Reporter: Chris Baxter
Priority: Minor
In our system, we have each clients data in a separate DB instance. We're using JPA (via hibernate) on top of that to get at the data. The problem here is that for each client DB supported by one of our jboss servers, we have to have an instance of EntityManagerFactory compete with an Ejb3Configuration instance. Each config instance takes up around 20 MBs of permanent space, so if we have have 1000 client DBs supported by a jboss instance, it takes up a hugh amount of memory for information that will always be the same (the DB schemas are always the exact same in each client DB) across all EntityManagerFactory instances. So what I want to know is if there is a way to only have one instance of Ejb3Configuration that can be shared across all of the EntityManagerFactory instances that are spawning my EntityManagers. This would be huge as it would help me save many gigs of memory that never can be collected (old gen in jboss).
I prototyped some changes locally to Ejb3Configuration (to allow an instance of AnnotationConfiguration to be supplied in the constructor, allowing sharing across all instanced of this class) and to SessionFactoryImpl (to share some of the properties like entityPersisters, classMetadata and such) and I was able to reduce the footprint to 20 MBs for the first DB and then under a MB for each additional DB. The changes I made were a bit quick and dirty though, just to see if it was possible. So I'm taking out this feature request to see if this is a piece of work that you guys can do (or I can contribute after refactoring to a more suitable approach) and integrate into the main code for hibernate-core and hibernate-entitymanager. Let me know if this is something you guys think to be a valuable addition.
--
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
11 years, 11 months
[Hibernate-JIRA] Created: (HHH-3465) HiRDB Support
by Tomoto Shimizu Washio (JIRA)
HiRDB Support
-------------
Key: HHH-3465
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3465
Project: Hibernate3
Issue Type: New Feature
Components: core
Affects Versions: 3.2.5
Environment: 3.2.5 + HiRDB V8 + Type4 JDBC Driver
Reporter: Tomoto Shimizu Washio
Attachments: hirdbdialect.patch
I would like to contribute with a dialect for HiRDB, Hitachi's RDBMS.
(For more information, please see http://www.hitachi.co.jp/Prod/comp/soft1/global/prod/hirdb/)
I added 4 classes and slightly modified 2 existing classes as shown below. Please look at the documentation at the top of the patch for explanations.
org.hibernate.dialect.HiRDBDialect (added)
org.hibernate.dialect.UserFuncDeclParser (added)
org.hibernate.dialect.DialectFactory (modified)
org.hibernate.dialect.function.AnsiTrimEmulationFunction (modified)
org.hibernate.dialect.function.AnsiTrimEmulationFunctionWithTrimstrs (added)
org.hibernate.dialect.function.TypeQualifiedSQLFunction (added)
You may think this code is relatively large as a dialect. It is because I also implemented user-defined function support. As HiRDB requires '?' parameters to be qualified by 'as <type>' in user-defined function invocations, I made a parser for the type declarations that the user specified in the properties file, and a renderer for the type qualifier. See javadoc comments of HiRDBDialect and UserFuncDeclParser for more details.
This patch is created on Hibernate 3.2.5.ga and tested on HiRDB V8 with Type4 JDBC Driver. The example configuration for HiRDB is shown below:
hibernate.dialect org.hibernate.dialect.HiRDBDialect
hibernate.connection.driver_class JP.co.Hitachi.soft.HiRDB.JDBC.HiRDBDriver
hibernate.connection.url jdbc:hitachi:hirdb://DBID=@HIRDBENVGRP=C:/hirdb.ini
hibernate.connection.username hitachi
hibernate.connection.password hitachi
--
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
11 years, 11 months
[Hibernate-JIRA] Created: (HHH-5554) Customise column aliasing scheme
by Chris Pheby (JIRA)
Customise column aliasing scheme
--------------------------------
Key: HHH-5554
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5554
Project: Hibernate Core
Issue Type: Patch
Components: core
Affects Versions: 3.6.0.Beta4
Reporter: Chris Pheby
Attachments: alias-patch.patch
Currently, the column aliasing scheme is hardcoded in the method public String getAlias(Dialect dialect) of the Column class. Essentially, this constructs an alias by creating a prefix using any characters up to the first non-letter character in the column name. This is usually followed by '_' and a number for disambiguation.
I am working with a legacy database where many columns share common prefixes such as 'CUS_', 'COL_'. These mean all the aliases end up being the same for many columns, making queries difficult to debug.
This patch configures aliasing via Dialect, which was already being done for getMaxAliasLength(). This makes it possible to customise the behaviour by extending the Dialect being used. It does not otherwise change the standard behaviour.
--
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
11 years, 11 months