RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Raible, Matt
Here's how I do it - in my TestCases, I call: ses = ServiceLocator.currentSession(); And in my app, when running on Tomcat, I have a filter with the following method: public static Session getSession() throws HibernateException, SQLException { return ServiceLocator.curr

RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Joseph Fifield
Hmm... This is a good point. I am currently using dbcp in hibernate for my connections, so this isn't a problem for me either. I would, however, like to eventually move to an app server provided datasource. I wonder how I will run my tests then...? Joe > -Original Message- > From: [EMAIL

RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Raible, Matt
I get it - I guess I'll just keep with my old JNDI-for-web/Datastore-for-tests method then. Thanks, Matt > -Original Message- > From: Jason Carreira [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 05, 2003 1:40 PM > To: Raible, Matt; [EMAIL PROTECTED] > Subject: RE: [Hibernate] Hib

RE: [Hibernate] Nested components of a single class

2003-02-05 Thread Craig Goss
Arrgh. Must have been asleep when I asked that one. Property column does the trick. --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 Se

RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Raible, Matt
I tried using this, but I'm getting the following exception: [junit] DEBUG [main] ServiceLocator.(44) | Looking up Session in JNDI [junit] INFO [main] ServiceLocator.(49) | error communicating with JNDI, assuming testcase [junit] FATAL [main] DatasourceConnectionProvider.configure(44)

[Hibernate] Nested components of a single class

2003-02-05 Thread Craig Goss
Hi Gavin: What is the recommended method for handling the following? I want to store this data in the parent table so that a join isn't necessary to load it. Hibernate gets the mapping below, but only allocates a single column for 'units' and 'value'.

RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Jason Carreira
Hi Joseph, Thank you very much! This works great! We're using a static member var to hold the SessionFactory that is initialized in a static block. Is this a common pattern for saving the SessionFactory? Thanks again, Jason > -Original Message- > From: Joseph Fifield [mailto:[EMAIL PROT

Re: [Hibernate] dependent object that is a reference to another hibernate object

2003-02-05 Thread Justen Stepka
After looking into this a bit more I have tracked the problem down to the following... // look for existing category... existingCategory = findByName(category.getName()); if ((existingCategory != null) && (existingCategory.getId() != category.getId())) { throw new InvalidCategoryException("Cat

RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Jason Carreira
Well, since the Hibernate.configure() is probably just using the same thing, then mapping it into JNDI, I mind as well just save it myself and save myself the complexity of switching implementations and doing the JNDI lookup. > -Original Message- > From: Joseph Fifield [mailto:[EMAIL PROTE

RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Joseph Fifield
Since it's threadsafe, it shouldn't be a problem. I obtain the reference and cache it as a static member inside a ServiceLocator. That way it's easy to switch between JNDI and manual configuration. You could probably even have the ServiceLocator switch automatically, depending on if you're running

[Hibernate] Distributed Cache: JCS?

2003-02-05 Thread Jason Carreira
Hi all, I'm wondering what the status of implementing a distributed, cluster-safe cache is? The JCS page (http://jakarta.apache.org/turbine/jcs/) says one of its features is "Remote synchronization", so I'm wondering if using JCS can now enable a cluster-wide synchronized cache? I know the Hiberna

RE: [Hibernate] Hibernate.cfg.xml without JNDI

2003-02-05 Thread Joseph Fifield
Yes, it is possible. Something like this should do the trick: factory = new Configuration("/hibernate.cfg.xml").configure()[0]; Joe > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Jason Carreira > Sent: Wednesday, February 05, 2003 12:13 PM > T

RE: [Hibernate] Parent / Child Mapping with composite-id

2003-02-05 Thread Raible, Matt
I tried you suggestion, in the following composite-id form: And now I get: [junit] org.appfuse.persistence.DAOException: cirrus.hibernate.MappingException: An association refers to an unmapped class: java.lang.Long So I thought, "hmmm, maybe the

[Hibernate] question about dialects..

2003-02-05 Thread Max Rydahl Andersen
While loading hibernate2 into a clean eclipse workspace I spotted that all dialects implement an deprecated method in Dialect: /** * The syntax used to add a column to a table. * @deprecated not supported on many platforms * @return String */ public abstract String getAddColumnString(); W

Re: [Hibernate] Updated Logo

2003-02-05 Thread Christian Bauer
On 04 Feb (19:13), Max Rydahl Andersen wrote: > Could you not keep the different versions on the page so people can compare > the differences ? The old version is back online now. -- Christian Bauer [EMAIL PROTECTED] --- This SF.NET email is

Re: [Hibernate] Parent / Child Mapping with composite-id

2003-02-05 Thread jiesheng zhang
> > table="child"> > class="org.appfuse.persistence.ChildId" > unsaved-value="none"> > length="22" name="parentId" > type="long"/> Try this: and remove the the below. > length="22" name="recordNum" > type="long"/> > > nam

Re: [Hibernate] dependent object that is a reference to another hibernate object

2003-02-05 Thread Justen Stepka
Yup.. that's how I got the saves working before... here is my setup... then here is the HibernateNote object..

Re: [Hibernate] dependent object that is a reference to another hibernate object

2003-02-05 Thread Gavin . King
If you don't want the save() to cascade, you should set cascade="none" or cascade="delete" on the association to User. (Also, as long as unsaved-value is correct, the save() will cascade to an update() of the User, which is okay usually.)

Re: [Hibernate] Hib2: Create/update schema pattern

2003-02-05 Thread Gavin . King
Hi Patrick :) The SchemaUpdate and SchemaExport tool classes live in the cirrus.hibernate.tools or net.sf.hibernate.tool.hbm2ddl packages. You should be aware that SchemaUpdate is not yet as mature as we might like

Re: [Hibernate] DeathMarch Error Message

2003-02-05 Thread Gavin . King
How disconcerting. The exception is being thrown by the JDBC driver and is most likely something to do with connection pooling. Looks like you should disable C3P0's prepared statement cache. (Or try some other connection pool implementation...)

[Hibernate] dependent object that is a reference to another hibernate object

2003-02-05 Thread Justen Stepka
I am having a problem with my already existing objects being persisted into the database when I call saveOrUpdate(). What happens is that I am putting the User object into my servlet session so that I can access the values of the account on the view (JSP pages). When I call on an operation later i

[Hibernate] Hib2: Create/update schema pattern

2003-02-05 Thread Patrick Lightbody
Anyone got any good patterns for making sure tha the database schema is up-to-date (create/update/delete) when a web-app starts? I'm guessing that a ServletListener or Servlet that loads on startup would execute some code that utilizes Configuration.generateSchemaUpdateScript(), but I just don't h