-->
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.  [ 2 posts ] 
Author Message
 Post subject: session.getConnection().setCatalog(<catalog name>)
PostPosted: Tue Mar 28, 2006 12:14 pm 
Beginner
Beginner

Joined: Fri Oct 15, 2004 10:29 am
Posts: 21
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.2.0CR1

Mapping documents:

Code between sessionFactory.openSession() and session.close():
session.getConnection().setCatalog(to something diff than sess fac config);
Criteria.list() // works fine
Criteria.list() // fails because the original catalog from the session factory is used

Is there a setting to tell hibernate not to switch back to the factory catalog?

Full stack trace of any exception that occurs:

Name and version of the database you are using:
SQL Server 2000 with jTDS 1.2 driver.

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: 2c
PostPosted: Tue Mar 28, 2006 3:34 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Two ways:
- create a new session factory and programmatically set the default catalog;
- or use custom connection supplier (DataSource), for example like this:
http://sandbox.sourcelabs.com/kosta/hb- ... ation.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.