I am using Hibernate 2.1.5 with Jboss 4.0.ORC2 and Mysql 4.1.10 and everything is working very well. I am going to distribute my application in a production enviroment and I am concerned that I might not have configured hibernate properly. In particular I would like to make sure that my connection pooling properties are correct.
Below is my hibername.cfg.xml file.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<hibernate-configuration>
<session-factory>
<!-- properties -->
<property name="connection.username">admin</property>
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="show_sql">false</property>
<property name="connection.url">jdbc:mysql://localhost:3306/superiordb</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="session_factory_name">hibernate/HibernateFactory</property>
<property name="connection.password">xxxxxx</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- mapping files -->
<mapping resource="org/database/data/Categories.hbm.xml"/>
<mapping resource="org/database/data/Suppliers.hbm.xml"/>
<mapping resource="org/database/data/Customers.hbm.xml"/>
<mapping resource="org/database/data/MonthItemCust.hbm.xml"/>
<mapping resource="org/database/data/SalesmanExpenses.hbm.xml"/>
<mapping resource="org/database/data/PeriodItemCust.hbm.xml"/>
<mapping resource="org/database/data/Addresses.hbm.xml"/>
<mapping resource="org/database/data/QuoteLines.hbm.xml"/>
<mapping resource="org/database/data/Measures.hbm.xml"/>
<mapping resource="org/database/data/Currencies.hbm.xml"/>
<mapping resource="org/database/data/Lots.hbm.xml"/>
<mapping resource="org/database/data/Items.hbm.xml"/>
<mapping resource="org/database/data/Images.hbm.xml"/>
<mapping resource="org/database/data/Sizes.hbm.xml"/>
<mapping resource="org/database/data/Reminders.hbm.xml"/>
<mapping resource="org/database/data/TransactionTypes.hbm.xml"/>
<mapping resource="org/database/data/ExpenseTypes.hbm.xml"/>
<mapping resource="org/database/data/Companies.hbm.xml"/>
<mapping resource="org/database/data/CustomerItems.hbm.xml"/>
<mapping resource="org/database/data/SalesmanRegions.hbm.xml"/>
<mapping resource="org/database/data/Regions.hbm.xml"/>
<mapping resource="org/database/data/Salesmen.hbm.xml"/>
<mapping resource="org/database/data/ControlParameters.hbm.xml"/>
<mapping resource="org/database/data/ShippingAddresses.hbm.xml"/>
<mapping resource="org/database/data/InvoiceTypes.hbm.xml"/>
<mapping resource="org/database/data/CustomerTypes.hbm.xml"/>
<mapping resource="org/database/data/Contacts.hbm.xml"/>
<mapping resource="org/database/data/CustomerCodes.hbm.xml"/>
<mapping resource="org/database/data/Statuses.hbm.xml"/>
<mapping resource="org/database/data/Locations.hbm.xml"/>
<mapping resource="org/database/data/Quotes.hbm.xml"/>
<mapping resource="org/database/data/ContactTypes.hbm.xml"/>
<mapping resource="org/database/data/ItemLocations.hbm.xml"/>
<mapping resource="org/database/data/Users.hbm.xml"/>
<mapping resource="org/database/data/Terms.hbm.xml"/>
<mapping resource="org/database/data/CustomersCompany.hbm.xml"/>
<mapping resource="org/database/data/GenerateCodes.hbm.xml"/>
</session-factory>
</hibernate-configuration>
When my application starts up the following messages are shown on the Eclipse console.
14:58:03,247 INFO [Server] JBoss (MX MicroKernel) [4.0.0RC2 (build: CVSTag=HEAD date=200409051753)] Started in 49s:997ms
14:58:28,903 INFO [Environment] Hibernate 2.1.5
14:58:29,008 INFO [Environment] hibernate.properties not found
14:58:29,046 INFO [Environment] using CGLIB reflection optimizer
14:58:29,064 INFO [Configuration] configuring from resource: /hibernate.cfg.xml
14:58:29,064 INFO [Configuration] Configuration resource: /hibernate.cfg.xml
14:58:29,156 INFO [Configuration] Mapping resource: org/database/data/Categories.hbm.xml
14:58:29,501 INFO [Binder] Mapping class: org.database.data.Categories -> categories
14:58:29,880 INFO [Configuration] Mapping resource: org/database/data/Suppliers.hbm.xml
14:58:29,932 INFO [Binder] Mapping class: org.database.data.Suppliers -> suppliers
14:58:29,935 INFO [Configuration] Mapping resource: org/database/data/Customers.hbm.xml
14:58:30,020 INFO [Binder] Mapping class: org.database.data.Customers -> customers
14:58:30,140 INFO [Configuration] Mapping resource: org/database/data/MonthItemCust.hbm.xml
14:58:30,198 INFO [Binder] Mapping class: org.database.data.MonthItemCust -> month_item_cust
14:58:30,226 INFO [Configuration] Mapping resource: org/database/data/SalesmanExpenses.hbm.xml
14:58:30,289 INFO [Binder] Mapping class: org.database.data.SalesmanExpenses -> salesman_expenses
14:58:30,330 INFO [Configuration] Mapping resource: org/database/data/PeriodItemCust.hbm.xml
14:58:30,365 INFO [Binder] Mapping class: org.database.data.PeriodItemCust -> period_item_cust
14:58:30,372 INFO [Configuration] Mapping resource: org/database/data/Addresses.hbm.xml
14:58:30,405 INFO [Binder] Mapping class: org.database.data.Addresses -> addresses
14:58:30,408 INFO [Configuration] Mapping resource: org/database/data/QuoteLines.hbm.xml
14:58:30,464 INFO [Binder] Mapping class: org.database.data.QuoteLines -> quote_lines
14:58:30,496 INFO [Configuration] Mapping resource: org/database/data/Measures.hbm.xml
14:58:30,554 INFO [Binder] Mapping class: org.database.data.Measures -> measures
14:58:30,556 INFO [Configuration] Mapping resource: org/database/data/Currencies.hbm.xml
14:58:30,587 INFO [Binder] Mapping class: org.database.data.Currencies -> currencies
14:58:30,588 INFO [Configuration] Mapping resource: org/database/data/Lots.hbm.xml
14:58:30,619 INFO [Binder] Mapping class: org.database.data.Lots -> lots
14:58:30,620 INFO [Configuration] Mapping resource: org/database/data/Items.hbm.xml
14:58:30,733 INFO [Binder] Mapping class: org.database.data.Items -> items
14:58:30,765 INFO [Configuration] Mapping resource: org/database/data/Images.hbm.xml
14:58:30,816 INFO [Binder] Mapping class: org.database.data.Images -> images
14:58:30,818 INFO [Configuration] Mapping resource: org/database/data/Sizes.hbm.xml
14:58:30,856 INFO [Binder] Mapping class: org.database.data.Sizes -> sizes
14:58:30,857 INFO [Configuration] Mapping resource: org/database/data/Reminders.hbm.xml
14:58:30,956 INFO [Binder] Mapping class: org.database.data.Reminders -> reminders
14:58:30,960 INFO [Configuration] Mapping resource: org/database/data/TransactionTypes.hbm.xml
14:58:30,989 INFO [Binder] Mapping class: org.database.data.TransactionTypes -> transaction_types
14:58:30,991 INFO [Configuration] Mapping resource: org/database/data/ExpenseTypes.hbm.xml
14:58:31,044 INFO [Binder] Mapping class: org.database.data.ExpenseTypes -> expense_types
14:58:31,046 INFO [Configuration] Mapping resource: org/database/data/Companies.hbm.xml
14:58:31,091 INFO [Binder] Mapping class: org.database.data.Companies -> companies
14:58:31,092 INFO [Configuration] Mapping resource: org/database/data/CustomerItems.hbm.xml
14:58:31,136 INFO [Binder] Mapping class: org.database.data.CustomerItems -> customer_items
14:58:31,141 INFO [Configuration] Mapping resource: org/database/data/SalesmanRegions.hbm.xml
14:58:31,182 INFO [Binder] Mapping class: org.database.data.SalesmanRegions -> salesman_regions
14:58:31,184 INFO [Configuration] Mapping resource: org/database/data/Regions.hbm.xml
14:58:31,246 INFO [Binder] Mapping class: org.database.data.Regions -> regions
14:58:31,247 INFO [Configuration] Mapping resource: org/database/data/Salesmen.hbm.xml
14:58:31,299 INFO [Binder] Mapping class: org.database.data.Salesmen -> salesmen
14:58:31,302 INFO [Configuration] Mapping resource: org/database/data/ControlParameters.hbm.xml
14:58:31,337 INFO [Binder] Mapping class: org.database.data.ControlParameters -> control_parameters
14:58:31,339 INFO [Configuration] Mapping resource: org/database/data/ShippingAddresses.hbm.xml
14:58:31,385 INFO [Binder] Mapping class: org.database.data.ShippingAddresses -> shipping_addresses
14:58:31,388 INFO [Configuration] Mapping resource: org/database/data/InvoiceTypes.hbm.xml
14:58:31,446 INFO [Binder] Mapping class: org.database.data.InvoiceTypes -> invoice_types
14:58:31,449 INFO [Configuration] Mapping resource: org/database/data/CustomerTypes.hbm.xml
14:58:31,477 INFO [Binder] Mapping class: org.database.data.CustomerTypes -> customer_types
14:58:31,478 INFO [Configuration] Mapping resource: org/database/data/Contacts.hbm.xml
14:58:31,508 INFO [Binder] Mapping class: org.database.data.Contacts -> contacts
14:58:31,519 INFO [Configuration] Mapping resource: org/database/data/CustomerCodes.hbm.xml
14:58:31,562 INFO [Binder] Mapping class: org.database.data.CustomerCodes -> customer_codes
14:58:31,565 INFO [Configuration] Mapping resource: org/database/data/Statuses.hbm.xml
14:58:31,594 INFO [Binder] Mapping class: org.database.data.Statuses -> statuses
14:58:31,596 INFO [Configuration] Mapping resource: org/database/data/Locations.hbm.xml
14:58:31,674 INFO [Binder] Mapping class: org.database.data.Locations -> locations
14:58:31,679 INFO [Configuration] Mapping resource: org/database/data/Quotes.hbm.xml
14:58:31,712 INFO [Binder] Mapping class: org.database.data.Quotes -> quotes
14:58:31,719 INFO [Configuration] Mapping resource: org/database/data/ContactTypes.hbm.xml
14:58:31,764 INFO [Binder] Mapping class: org.database.data.ContactTypes -> contact_types
14:58:31,767 INFO [Configuration] Mapping resource: org/database/data/ItemLocations.hbm.xml
14:58:31,800 INFO [Binder] Mapping class: org.database.data.ItemLocations -> item_locations
14:58:31,805 INFO [Configuration] Mapping resource: org/database/data/Users.hbm.xml
14:58:31,840 INFO [Binder] Mapping class: org.database.data.Users -> users
14:58:31,844 INFO [Configuration] Mapping resource: org/database/data/Terms.hbm.xml
14:58:31,903 INFO [Binder] Mapping class: org.database.data.Terms -> terms
14:58:31,904 INFO [Configuration] Mapping resource: org/database/data/CustomersCompany.hbm.xml
14:58:31,951 INFO [Binder] Mapping class: org.database.data.CustomersCompany -> customers_company
14:58:31,953 INFO [Configuration] Mapping resource: org/database/data/GenerateCodes.hbm.xml
14:58:31,995 INFO [Binder] Mapping class: org.database.data.GenerateCodes -> generate_codes
14:58:31,997 INFO [Configuration] Configured SessionFactory: null
14:58:31,999 INFO [Configuration] processing one-to-many association mappings
14:58:32,000 INFO [Configuration] processing one-to-one association property references
14:58:32,001 INFO [Configuration] processing foreign key constraints
14:58:32,173 INFO [Dialect] Using dialect: net.sf.hibernate.dialect.MySQLDialect
14:58:32,179 INFO [SettingsFactory] Use outer join fetching: false
14:58:32,195 INFO [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
14:58:32,196 INFO [DriverManagerConnectionProvider] Hibernate connection pool size: 20
14:58:32,231 INFO [DriverManagerConnectionProvider] using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/superiordb
14:58:32,232 INFO [DriverManagerConnectionProvider] connection properties: {user=admin, password=xxxxxxx}
14:58:32,240 INFO [TransactionFactoryFactory] Transaction strategy: net.sf.hibernate.transaction.JTATransactionFactory
14:58:32,256 INFO [NamingHelper] JNDI InitialContext properties:{}
14:58:32,267 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
14:58:32,334 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
14:58:32,335 INFO [NamingHelper] JNDI InitialContext properties:{}
14:58:32,336 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
14:58:32,337 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
14:58:33,058 INFO [SettingsFactory] Use scrollable result sets: true
14:58:33,059 INFO [SettingsFactory] Use JDBC3 getGeneratedKeys(): true
14:58:33,059 INFO [SettingsFactory] Optimize cache for minimal puts: false
14:58:33,060 INFO [SettingsFactory] Query language substitutions: {}
14:58:33,060 INFO [SettingsFactory] cache provider: net.sf.ehcache.hibernate.Provider
14:58:33,089 INFO [Configuration] instantiating and configuring caches
14:58:33,611 INFO [SessionFactoryImpl] building session factory
14:58:37,986 INFO [SessionFactoryObjectFactory] Factory name: hibernate/HibernateFactory
14:58:37,987 INFO [NamingHelper] JNDI InitialContext properties:{}
14:58:37,989 INFO [NamingHelper] Creating subcontext: hibernate
14:58:37,990 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: hibernate/HibernateFactory
14:58:37,992 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
14:58:37,993 INFO [NamingHelper] JNDI InitialContext properties:{}
The message that I am concerned with is:
[DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
I am not sure which connection pool to use or how to change it.
Thank you in advance for looking at my question.
Anna[/b]
|