[Hibernate] Connection Pooling / Connection Validation - best practices?

2003-08-27 Thread Dave Tilley
Howdy, I've been having trouble getting Connection Pooling working with either C3P0 or DBCP and using MySQL... the connection dies after some number of hours and the next time the webapp is used, it hangs, and an ioException is logged with a connection failure. I have been told there is some

Re: [Hibernate] Connection Pooling / Connection Validation - bestpractices?

2003-08-27 Thread Mark Woon
Dave Tilley wrote: I've been having trouble getting Connection Pooling working with either C3P0 or DBCP and using MySQL... the connection dies after some number of hours and the next time the webapp is used, it hangs, and an ioException is logged with a connection failure. I have been tol

Re: [Hibernate] Cascading inserts

2003-08-27 Thread Prasad Iyer
Thanks For the help really appreciate that. Wanted to ask one more thing is nested transaction possible in Hibernate. That is can I write code something like this. public void addCat()throws Exception{ Session session=null; Transaction tx=null; Cat cat=new Cat("Scarlet"); cat.addKitten(new Kit

Re: [Hibernate] Cascading inserts

2003-08-27 Thread Gavin King
No. Transaction.rollback() does NOT restore the state of the session to the state prior to Transaction.begin(). You should close the Session after rolling back a transaction. > Thanks > For the help really appreciate that. > Wanted to ask one more thing is nested transaction possible in Hibernate.

RE: [Hibernate] build structure

2003-08-27 Thread Eric Pugh
Les, I think you bring up some very good points. While I'll just toss it out as a nomination, Maven has done a lot of work dealing with these multiple related project issues. The reactor allows you to build a series of projects, and sorts out any interdependencies they have. It deals with a cha

Re: [Hibernate] build structure

2003-08-27 Thread Christian Bauer
On 27 Aug (10:13), Eric Pugh wrote: > The avalon wrapper is built using Maven, and maven is called from the parent > ant script that builds the rest of the extensions if you want to see an > example. Please stop this discussion. The Hibernate core build process is fine. We don't need Maven, use

Re: [Hibernate] CGLib problem

2003-08-27 Thread Konstantin Priblouda
--- Jim Downing <[EMAIL PROTECTED]> wrote: > Hi, > > quick question - which version of cglib does > hibernate-2.0-final.jar > depend on? > > If anyone else is using maven for their builds, does > either of the > jars in http://www.ibiblio.org/maven/cglib/jars/ > work with hibernate > 2.0 final?

RE: [Hibernate] build structure

2003-08-27 Thread Gavin King
In my opinion: * splitting the tools out of the Hibernate core was the one of the best things we ever did - it keeps the download small enough and external dependencies under control (Hibernate was starting to look very bloated) * Maven looked great until I actually tried to use it and realized

Re: [Hibernate] build structure

2003-08-27 Thread Max Rydahl Andersen
The day maven can easily handle projects with multiple source directories (not just src, i mean modules/hibern8ide, modules/tools, modules/core) etc. Then I would consider to try using Maven...Maven is VERY monotlithic in it's structure - and that is exactly the opposite of what you are asking

Re: [Hibernate] Re: MapGenerator problem

2003-08-27 Thread Max Rydahl Andersen
k - what happens if you move it to a package ? /max Madhesh wrote: Hi, The class was actually in the classpath. But, the Employee class is not in any package; it is just in the default package. Regards Madhesh <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] The class named "Empl

Re: [Hibernate] Connection Pooling / Connection Validation - best practices?

2003-08-27 Thread Ludvig Omholt
On Wed, Aug 27, 2003 at 02:19:09AM -0400, Dave Tilley wrote: > > Howdy, > > I've been having trouble getting Connection Pooling working with > either C3P0 or DBCP and using MySQL... the connection dies after some > number of hours and the next time the webapp is used, it hangs, and

Re: [Hibernate] Connection Pooling / Connection Validation - best practices?

2003-08-27 Thread Gavin King
Someone has claimed that this parameter doesn't work if autocommit is disabled (Hibernate always disables autocommit). I don't know if this is true or not. > You can pass autoReconnect=true in the JDBC URL which makes the > MySQL-driver > attempt to reconnect if the connection dies. > > See: > ht

Re: [Hibernate] build structure

2003-08-27 Thread Max Rydahl Andersen
The day maven can easily handle projects with multiple source directories (not just src, i mean modules/hibern8ide, modules/tools, modules/core) etc. Then I would consider to try using Maven...Maven is VERY monotlithic in it's structure - and that is exactly the opposite of what you are asking

Re: [Hibernate] Connection Pooling / Connection Validation - best practices?

2003-08-27 Thread Ludvig Omholt
FWIW: At our site we use this parameter in a Tomcat DBCP-resource with autocommit false if i recall correctly. We have not seen any losses of database connections. On Wed, Aug 27, 2003 at 07:37:46PM +1000, Gavin King wrote: > > Someone has claimed that this parameter doesn't work if autocommit is

Re: [Hibernate] build structure

2003-08-27 Thread Max Rydahl Andersen
i'll try looking into it again - but if they have seperate source directories without a common root, i'll be sad ;) Currently every plugin is self contained and has own source tree. But nothing prevents you to specify source directory somewhere else ( say, under hibernate source roor like: src/c

RE: [Hibernate] build structure

2003-08-27 Thread Sandeep Dath
Les, Sounds interesting, but Java lib directories are getting ever more complex. Between the Jakarta set of tools and other little pieces that go into making a large framework tick - you can easily end up with version mismatches. $APP_HOMEs need consistent usage for them to work. My opinion is th

RE: [Hibernate] build structure

2003-08-27 Thread Les Hazlewood
Title: RE: [Hibernate] build structure > The "über" layout i'm looking for is: > > hibernate/modules/core > hibernate/modules/core/etc > hibernate/modules/core/src/java > > hibernate/modules/hbm2java > hibernate/modules/hbm2java/etc hibernate/modules/hbm2java/src/java > That is _exactly_

Re: [Hibernate] Re: API stability in SchemaUpdate

2003-08-27 Thread Serge Knystautas
Laura Werner wrote: Serge Knystautas wrote: The SchemaUpdate tool as is does not work in this environment. I need to SQL statements that Hibernate suggests could get the database to a stable environment. Maybe I'm missing something, but can't you just do something like this: java -cp... ne

Re: [Hibernate] Connection Pooling / Connection Validation - best practices?

2003-08-27 Thread Dave Tilley
Ok, So it seems to me that to use C3P0, you must set the following four paramaters. hibernate.c3p0.max_size =maximum connection pool size hibernate.c3p0.min_size = minimum connection pool size hibernate.c3p0.timeout = maximum idle time hibernate.c3p0.max_statements =size of statement cache

Re: [Hibernate] build structure

2003-08-27 Thread Christian Bauer
On 27 Aug (10:00), Les Hazlewood wrote: > Unfortunately, this approach does not solve the versioning dependencies, but > at least it is a manageable approach to getting jar files out of cvs. Why do we want the dependent JARs out of CVS? -- Christian Bauer [EMAIL PROTECTED] --

Re: [Hibernate] build structure

2003-08-27 Thread Max Rydahl Andersen
I like your ideas, but plesae do not mix hibernate and hibernateext again. If you want to improve something - then improve hibernateext build system. I already has the proposed structure (except avalon plugin which is partially maven (not good!)) And another point - please do NOT use environmen

RE: [Hibernate] build structure

2003-08-27 Thread Les Hazlewood
Title: RE: [Hibernate] build structure > -Original Message- > From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 27, 2003 10:34 AM > To: Les Hazlewood > Cc: hibernate list > Subject: Re: [Hibernate] build structure > > > I like your ideas, but plesae do

Re: [Hibernate] Connection Pooling / Connection Validation - best practices?

2003-08-27 Thread Travis Reeder
The latest c3p0 has a new property, this is fromt he c3p0 developer a while back: I've added a new configuration property, idleConnectionTestPeriod, which if set to a number of seconds greater than zero, causes idle connections in the pool to be periodically checked, and discarded if they are bro

RE: [Hibernate] build structure

2003-08-27 Thread Gavin King
IMO, environment variables ensure that users can't build the project by simply checking out and typing "ant". Please no environment variables! > >> -Original Message- >> From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, August 27, 2003 10:34 AM >> To: Les Hazlewood

RE: [Hibernate] build structure

2003-08-27 Thread Schnitzer, Jeff
Les, you come from a heavy C/C++/make background eh? Env variables are pretty common in make-land but almost unheard of in java-land. To restate what Gavin just said as a hard requirement: Anyone with Java and Ant installed on their system must be able to check out the CVS tree and build

RE: [Hibernate] build structure

2003-08-27 Thread Les Hazlewood
Title: RE: [Hibernate] build structure > IMO, environment variables ensure that users can't build the > project by simply checking out and typing "ant". Please no > environment variables! > I will gladly adhere to the team's preferences, since I'm not a committer. :) But I'd like to ex

[Hibernate] Tables without primary key.

2003-08-27 Thread Fredrik Larsson
Hello. I would like to use hibernate and especially the criteria interface for an application that my company will be building. The problem is that the application will work against a legacy database (udb on mainframe) and that the tables contains no column marked as a primary key. Essentially the

[Hibernate] feature request (?)

2003-08-27 Thread Serge Knystautas
I'm using Hibernate is a servlet container, and I have a servlet context listener that configures Hibernate. What I noticed was that I had to put the JNDI datasource location in both the web.xml (for JSTL and servlets to use) and in the hibernate.cfg.xml. What I did was a bit of a hack... I ha

[Hibernate] Tables without primary key.

2003-08-27 Thread Fredrik Larsson
Hello. I would like to use hibernate and especially the criteria interface for an application that my company will be building. The problem is that the application will work against a legacy database (udb on mainframe) and that the tables contains no column marked as a primary key. Essentially the

RE: [Hibernate] build structure

2003-08-27 Thread Les Hazlewood
Title: RE: [Hibernate] build structure > Les, you come from a heavy C/C++/make background eh?  Env > variables are pretty common in make-land but almost unheard > of in java-land. Actually, I have a _deep_ foundation in Java with little C++ background. In fact, I have 3 times more "java

Re: [Hibernate] build structure

2003-08-27 Thread Vladimir Dozen
ehlo. My take on env vars has less to do with make and more of my school of thought keeping dependency binaries out of CVS. I view CVS as a _source_ control medium, not a build repository. Env vars are the logical choice for making clean builds when engaging in that school of thought. And

[Hibernate] Proxy equals() and hashCode()

2003-08-27 Thread Schnitzer, Jeff
Restating this more intelligibly. Currently: Proxy hashCode() always is the hashCode() of the identifier. Proxy equals() defaults to a comparison of identity unless the entity implements equals() itself, in which case proxies are always materialized for equals(). This keeps things working (alb

Re: [Hibernate] Proxy equals() and hashCode()

2003-08-27 Thread Gavin King
> But if the > entity doesn't override equals, everything gets wacky because equals() > is not reflexive: > > proxyA.equals(realA) != realA.equals(proxyA) In the current implementation, it can only break if we have the same object twice, once as a proxy, and once as a direct reference. This _is_

RE: [Hibernate] Proxy equals() and hashCode()

2003-08-27 Thread Schnitzer, Jeff
> From: Gavin King [mailto:[EMAIL PROTECTED] > > > But if the > > entity doesn't override equals, everything gets wacky because equals() > > is not reflexive: > > > > proxyA.equals(realA) != realA.equals(proxyA) > > In the current implementation, it can only break if we have the same > object tw