-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: [DriverManagerConnectionProvider] (newbie question)
PostPosted: Sun Mar 06, 2005 5:00 pm 
Newbie

Joined: Sun Jan 16, 2005 7:15 pm
Posts: 6
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]


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 5:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You should use a appserver managed datasource when running in an appserver.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 07, 2005 12:40 am 
Newbie

Joined: Sun Jan 16, 2005 7:15 pm
Posts: 6
Could I have an example of an appserver datasource?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 07, 2005 1:09 am 
Newbie

Joined: Sun Jan 16, 2005 7:15 pm
Posts: 6
Ok, sorry to be so thick. Here are the changes I made to my hibernate.cfg.xml file. Please let me
know if this is the complete correct solution.

<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">superior</property>
<!-- property name="connection.driver_class">com.mysql.jdbc.Driver</property -->
<property name="connection.provider_class">net.sf.hibernate.connection.DatasourceConnectionProvider</property>
<property name="connection.datasource">java:/MySqlDS</property>

<!-- mapping files -->
etc....

The console output when I start my application is:

23:52:11,647 INFO [Configuration] configuring from resource: /hibernate.cfg.xml
23:52:11,647 INFO [Configuration] Configuration resource: /hibernate.cfg.xml
23:52:11,685 INFO [Configuration] Mapping resource: org/database/data/Categories.hbm.xml
23:52:11,719 INFO [Binder] Mapping class: org.database.data.Categories -> categories
23:52:11,722 INFO [Configuration] Mapping resource: org/database/data/Suppliers.hbm.xml
23:52:11,772 INFO [Binder] Mapping class: org.database.data.Suppliers -> suppliers
23:52:11,775 INFO [Configuration] Mapping resource: org/database/data/Customers.hbm.xml
23:52:11,903 INFO [Binder] Mapping class: org.database.data.Customers -> customers
23:52:12,018 INFO [Configuration] Mapping resource: org/database/data/MonthItemCust.hbm.xml
23:52:12,077 INFO [Binder] Mapping class: org.database.data.MonthItemCust -> month_item_cust
23:52:12,109 INFO [Configuration] Mapping resource: org/database/data/SalesmanExpenses.hbm.xml
23:52:12,166 INFO [Binder] Mapping class: org.database.data.SalesmanExpenses -> salesman_expenses
23:52:12,203 INFO [Configuration] Mapping resource: org/database/data/PeriodItemCust.hbm.xml
23:52:12,263 INFO [Binder] Mapping class: org.database.data.PeriodItemCust -> period_item_cust
23:52:12,268 INFO [Configuration] Mapping resource: org/database/data/Addresses.hbm.xml
23:52:12,308 INFO [Binder] Mapping class: org.database.data.Addresses -> addresses
23:52:12,310 INFO [Configuration] Mapping resource: org/database/data/QuoteLines.hbm.xml
23:52:12,360 INFO [Binder] Mapping class: org.database.data.QuoteLines -> quote_lines
23:52:12,391 INFO [Configuration] Mapping resource: org/database/data/Measures.hbm.xml
23:52:12,424 INFO [Binder] Mapping class: org.database.data.Measures -> measures
23:52:12,425 INFO [Configuration] Mapping resource: org/database/data/Currencies.hbm.xml
23:52:12,485 INFO [Binder] Mapping class: org.database.data.Currencies -> currencies
23:52:12,487 INFO [Configuration] Mapping resource: org/database/data/Lots.hbm.xml
23:52:12,514 INFO [Binder] Mapping class: org.database.data.Lots -> lots
23:52:12,515 INFO [Configuration] Mapping resource: org/database/data/Items.hbm.xml
23:52:12,608 INFO [Binder] Mapping class: org.database.data.Items -> items
23:52:12,632 INFO [Configuration] Mapping resource: org/database/data/Images.hbm.xml
23:52:12,694 INFO [Binder] Mapping class: org.database.data.Images -> images
23:52:12,696 INFO [Configuration] Mapping resource: org/database/data/Sizes.hbm.xml
23:52:12,726 INFO [Binder] Mapping class: org.database.data.Sizes -> sizes
23:52:12,728 INFO [Configuration] Mapping resource: org/database/data/Reminders.hbm.xml
23:52:12,782 INFO [Binder] Mapping class: org.database.data.Reminders -> reminders
23:52:12,786 INFO [Configuration] Mapping resource: org/database/data/TransactionTypes.hbm.xml
23:52:12,833 INFO [Binder] Mapping class: org.database.data.TransactionTypes -> transaction_types
23:52:12,835 INFO [Configuration] Mapping resource: org/database/data/ExpenseTypes.hbm.xml
23:52:12,897 INFO [Binder] Mapping class: org.database.data.ExpenseTypes -> expense_types
23:52:12,899 INFO [Configuration] Mapping resource: org/database/data/Companies.hbm.xml
23:52:12,936 INFO [Binder] Mapping class: org.database.data.Companies -> companies
23:52:12,937 INFO [Configuration] Mapping resource: org/database/data/CustomerItems.hbm.xml
23:52:12,991 INFO [Binder] Mapping class: org.database.data.CustomerItems -> customer_items
23:52:12,996 INFO [Configuration] Mapping resource: org/database/data/SalesmanRegions.hbm.xml
23:52:13,062 INFO [Binder] Mapping class: org.database.data.SalesmanRegions -> salesman_regions
23:52:13,072 INFO [Configuration] Mapping resource: org/database/data/Regions.hbm.xml
23:52:13,102 INFO [Binder] Mapping class: org.database.data.Regions -> regions
23:52:13,103 INFO [Configuration] Mapping resource: org/database/data/Salesmen.hbm.xml
23:52:13,156 INFO [Binder] Mapping class: org.database.data.Salesmen -> salesmen
23:52:13,159 INFO [Configuration] Mapping resource: org/database/data/ControlParameters.hbm.xml
23:52:13,197 INFO [Binder] Mapping class: org.database.data.ControlParameters -> control_parameters
23:52:13,200 INFO [Configuration] Mapping resource: org/database/data/ShippingAddresses.hbm.xml
23:52:13,283 INFO [Binder] Mapping class: org.database.data.ShippingAddresses -> shipping_addresses
23:52:13,285 INFO [Configuration] Mapping resource: org/database/data/InvoiceTypes.hbm.xml
23:52:13,324 INFO [Binder] Mapping class: org.database.data.InvoiceTypes -> invoice_types
23:52:13,328 INFO [Configuration] Mapping resource: org/database/data/CustomerTypes.hbm.xml
23:52:13,360 INFO [Binder] Mapping class: org.database.data.CustomerTypes -> customer_types
23:52:13,361 INFO [Configuration] Mapping resource: org/database/data/Contacts.hbm.xml
23:52:13,381 INFO [Binder] Mapping class: org.database.data.Contacts -> contacts
23:52:13,395 INFO [Configuration] Mapping resource: org/database/data/CustomerCodes.hbm.xml
23:52:13,417 INFO [Binder] Mapping class: org.database.data.CustomerCodes -> customer_codes
23:52:13,420 INFO [Configuration] Mapping resource: org/database/data/Statuses.hbm.xml
23:52:13,460 INFO [Binder] Mapping class: org.database.data.Statuses -> statuses
23:52:13,462 INFO [Configuration] Mapping resource: org/database/data/Locations.hbm.xml
23:52:13,534 INFO [Binder] Mapping class: org.database.data.Locations -> locations
23:52:13,553 INFO [Configuration] Mapping resource: org/database/data/Quotes.hbm.xml
23:52:13,579 INFO [Binder] Mapping class: org.database.data.Quotes -> quotes
23:52:13,585 INFO [Configuration] Mapping resource: org/database/data/ContactTypes.hbm.xml
23:52:13,639 INFO [Binder] Mapping class: org.database.data.ContactTypes -> contact_types
23:52:13,640 INFO [Configuration] Mapping resource: org/database/data/ItemLocations.hbm.xml
23:52:13,708 INFO [Binder] Mapping class: org.database.data.ItemLocations -> item_locations
23:52:13,714 INFO [Configuration] Mapping resource: org/database/data/Users.hbm.xml
23:52:13,737 INFO [Binder] Mapping class: org.database.data.Users -> users
23:52:13,741 INFO [Configuration] Mapping resource: org/database/data/Terms.hbm.xml
23:52:13,771 INFO [Binder] Mapping class: org.database.data.Terms -> terms
23:52:13,774 INFO [Configuration] Mapping resource: org/database/data/CustomersCompany.hbm.xml
23:52:13,845 INFO [Binder] Mapping class: org.database.data.CustomersCompany -> customers_company
23:52:13,848 INFO [Configuration] Mapping resource: org/database/data/GenerateCodes.hbm.xml
23:52:13,892 INFO [Binder] Mapping class: org.database.data.GenerateCodes -> generate_codes
23:52:13,894 INFO [Configuration] Configured SessionFactory: null
23:52:13,896 INFO [Configuration] processing one-to-many association mappings
23:52:13,897 INFO [Configuration] processing one-to-one association property references
23:52:13,897 INFO [Configuration] processing foreign key constraints
23:52:13,903 INFO [Dialect] Using dialect: net.sf.hibernate.dialect.MySQLDialect
23:52:13,904 INFO [SettingsFactory] Use outer join fetching: false
23:52:13,904 INFO [ConnectionProviderFactory] Initializing connection provider: net.sf.hibernate.connection.DatasourceConnectionProvider
23:52:13,905 INFO [NamingHelper] JNDI InitialContext properties:{}
23:52:13,907 INFO [DatasourceConnectionProvider] Using datasource: java:/MySqlDS
23:52:13,919 INFO [TransactionFactoryFactory] Transaction strategy: net.sf.hibernate.transaction.JTATransactionFactory
23:52:13,940 INFO [NamingHelper] JNDI InitialContext properties:{}
23:52:13,948 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
23:52:13,967 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
23:52:13,968 INFO [NamingHelper] JNDI InitialContext properties:{}
23:52:13,969 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
23:52:13,969 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
23:52:14,682 INFO [SettingsFactory] Use scrollable result sets: true
23:52:14,683 INFO [SettingsFactory] Use JDBC3 getGeneratedKeys(): true
23:52:14,683 INFO [SettingsFactory] Optimize cache for minimal puts: false
23:52:14,684 INFO [SettingsFactory] Query language substitutions: {}
23:52:14,684 INFO [SettingsFactory] cache provider: net.sf.ehcache.hibernate.Provider
23:52:14,703 INFO [Configuration] instantiating and configuring caches
23:52:15,222 INFO [SessionFactoryImpl] building session factory
23:52:17,479 INFO [SessionFactoryObjectFactory] Factory name: hibernate/HibernateFactory
23:52:17,479 INFO [NamingHelper] JNDI InitialContext properties:{}
23:52:17,482 INFO [NamingHelper] Creating subcontext: hibernate
23:52:17,484 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: hibernate/HibernateFactory
23:52:17,485 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
23:52:17,486 INFO [NamingHelper] JNDI InitialContext properties:{}


Top
 Profile  
 
 Post subject: InitialContext did not implement EventContext
PostPosted: Tue May 31, 2005 9:30 am 
Beginner
Beginner

Joined: Mon Apr 18, 2005 10:25 am
Posts: 38
Location: Maryland
I can see several others getting this same output in the log. I eventually throw an exception that states: uncaught exception thrown Connection = null.

Where would I look for the title of this post problem? I believe something is not configure properly but what? I have a sybase-ds.xml in my deploy directory for jboss 4. I have a hibernate mbean defined in the meta-inf dir as well as have my hibernate.cfg.xml in that location. All my class files and mappings are found without fail. I am stumped as to where this comes from. Please respond.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 02, 2005 8:56 pm 
Newbie

Joined: Sun Jan 16, 2005 7:15 pm
Posts: 6
Outside of the hibernate.cfg.xml file I have the following class created that I use to connect to mysql database. The hibernate.cfg.xml file that I posted seems to be working correctly and has resolved the problem I stated in my initial post.

Please note that I had a sligtly different problem than you in that my connection worked, however I wished to make it a production connection as opposed to a test one.

To create my hibernate session factory class I used the example in the HIbernate in Action book by Christian Bauer which I found excellent.

Hope this helps

Anna

*
* Created on Jan 25, 2005
*
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.business.logic.sessions;

import java.rmi.RemoteException;
import java.util.Properties;

import javax.ejb.CreateException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;

import org.business.logic.exceptions.BusinessException;
import org.database.interfaces.CommandHandler;
import org.database.interfaces.CommandHandlerHome;

/**
* @author root
*
* Preferences - Java - Code Style - Code Templates
*/
public class BusinessConnections
{
public static String CONTEXT_PROVIDER_URL = "192.168.1.130:1099";

public static String CONTEXT_FACTORY_NAME = "org.jnp.interfaces.NamingContextFactory";

public static String CONTEXT_FACTORY_PKGS = "org.jboss.naming:org.jnp.interfaces";

public static String CONTEXT_URL_PKG_PREFIXES = "org.jboss.naming";

private static Object commandHandler;

private static Properties Properties = null;
/**
*
*/
static
{
Properties Properties = new Properties();
Properties.put("Context.PROVIDER_URL", CONTEXT_PROVIDER_URL);
Properties.put("Context.URL_PKG_PREFIXES", CONTEXT_URL_PKG_PREFIXES);
Properties.put("java.naming.provider.url", CONTEXT_PROVIDER_URL);
Properties.put("java.naming.factory.initial", CONTEXT_FACTORY_NAME);
Properties.put("java.naming.factory.url.pkgs", CONTEXT_FACTORY_PKGS);

commandHandler = null;
try
{
Context ctx = new InitialContext(Properties);

Object dataObject = ctx.lookup(CommandHandlerHome.JNDI_NAME);
CommandHandlerHome commandHandlerHome = (CommandHandlerHome) PortableRemoteObject
.narrow(dataObject, CommandHandlerHome.class);
commandHandler = (CommandHandler) commandHandlerHome.create();
}
catch (RemoteException ex)
{
throw new BusinessException(ex);
}
catch (CreateException ex)
{
throw new BusinessException(ex);
}
catch (NamingException ex)
{
throw new BusinessException(ex);
}
}

public static CommandHandler getCommandHandler() throws BusinessException
{
return (CommandHandler) commandHandler;
}
}


Top
 Profile  
 
 Post subject: I had mine working, can you share your getSession?
PostPosted: Fri Jun 17, 2005 10:10 am 
Beginner
Beginner

Joined: Mon Apr 18, 2005 10:25 am
Posts: 38
Location: Maryland
I had my connection working but there is something wrong with my getting the session. My list is empty but I'm not sure that is a valid output. I want to make sure I get the session correctly. Could you share your code on what you did? I even upgraded to hibernate 3 but ugh.

I tried to implement the use of HibernateContext.getSession(jndi name);

It worked at first try but now won't trying to find the root of the problem. I know get an WARN that states that [org.hibernate.jdbc,JDBCContext] no active transaction, could not register synchronization.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.