I have a base class that most of my persistent classes extend. In some
cases, the final class is three or four levels down (i.e. Foo2 extends
Foo1 extends FooBase). My database schema is such that I have to go
with the subclass-per-table strategy.
In situatations where I do not know the final
Eric Pugh wrote:
Wojciech,
I am debugging a problem in one of our apps that I think may be caused by
this same issue. It looks like it is recreating the Configuration on
every
request.. egads! I hestiate to add Poolable to HibernateServiceImpl
because that means that the container is now resp
Gavin King wrote:
Re: [Hibernate] Problem with polymorphism="explicit"
This is ALL as expected. You can not load the same
database row as two
different objects. That is pathalogical.
Isn't this exactly what the Lightweight Class pattern is supposed to
accomplish?
Can I open
Hi all,
I'm hoping someone can point me in the right direction. I'm using the
Lightweight Class design pattern and I cannot seem to get
polymorphism="explicit" working as expected.
I have an Info and Gene object, and when I try to do this:
Info info = (Info)session.load(Info.class, "PA267");
Dave Tilley wrote:
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Dave,
Here's a list of all the extra params I have to configure DBC
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
Which is it? all-gc or all-delete-orphan? In the Hibernate docs it
says all-delete-orphan, and in the DTD it says all-gc.
BTW, I'd like to thank whomever wrote the section on parent-child
relationships. It was a great help, although I do have one question:
if I want to add a removeChild() m
[EMAIL PROTECTED] wrote:
Re: [Hibernate] Precedence for Lifecycle and Interceptor?
Why not just
look in the source of SessionImpl?
Good point. Didn't know where to look.
For those who are interested, the order is:
Save or Update:
- Interceptor.isUnsaved
Save:
- Lifecycle.onSave
Prasad Iyer wrote:
[Hibernate] Hi, Log4j problem
Hi
I am using hibernate-plugin for eclipse.
I get this warning when I run this code.
log4j:WARN No appenders could be found for logger
(net.sf.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j
What exactly is the precedence for the Lifecycle and Interceptor
methods, especially for those with the same names? From my reading of
the docs, I'm guessing that the Lifecycle has precedence, so in general,
events would normally take place in the following order:
Interceptor.instantiate()
Lif
Gavin,
Have you had the time to take a loko at the patch for too-long column
aliases yet
(http://sourceforge.net/tracker/index.php?func=detail&aid=672865&group_id=40712&atid=428710)?
I noticed that you just released 1.2.3...
-Mark
---
Thi
[EMAIL PROTECTED] wrote:
Yes, I'm glad you raised this Ara, there are a couple of different
things I've been speculating about here:
(1) An isDirty() interceptor callback, to allow an application to
implement its own dirty checking algorithm
(2) A new property attribute; update="never|auto", to
Matt Raible wrote:
There probably isn't a nightly build I can grab then is there? I tried
to build hibernate today and received a lot of compile errors - causing
me to abandon mission. Can one of you committers send me your
ant.properties file so I can get an idea of how to build?
Hmm...
Hib
[EMAIL PROTECTED] wrote:
I mean, your column names differ by just the first three chars. Have a look
at your mapping. Your patch works by trimming characters from the start, to
get it down to the 20 char limit (I changed this to 15, for the benefit of
db2).
Just try changing your mapping, and see
Is it just me, or is anyone else having trouble connecting to
SourceForge's CVS server? I haven't been able to connect for over 24
hours now...
-Mark
---
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers
[EMAIL PROTECTED] wrote:
I think it might possibly be to do with your patch for long column names.
Try choosing much shorter column names and see what happens. (they are
distinguished only by the first three characters).
Really? If so, that's a really bad thing. We can't be expecting people
I'm getting some pretty weird behavior with component. Here's my mapping:
Gavin King wrote:
Has this thread died?
I still havn't got a really good feeling for what other people
think about this issue
+1, would much prefer SQLException be nested within HibernateException.
-Mark
---
This sf.net email is sponso
One Ovthafew wrote:
I'd like to propose a change to the Transaction API, for the purpose
of making the standard try/catch/finally idiom a bit cleaner. What I
would like is for the idiom to look like:
Session s = factory.openSession();
try {
//instantiate a new Transaction object, begin the tra
Mark Woon wrote:
And I'd be more than happy to implement the fix, if I can just figure
out which methods are actually producing the offending SQL. I'll try
looking at it later tonight. I'm getting really tired of renaming my
db columns...
I think I've got a reasonable
One Ovthafew wrote:
I am happy to introduce a JDBCException that wraps any SQLExceptions
that occur. However, I don't have a strong view either way. So lets just
vote on this
If JDBCException extended HibernateException, then I'd be +1 on this.
Fewer catch statements to write is always a g
max wrote:
Another one is to rewrite the code that produces those aliases (and as
I remember - the logic are well-defined but unfortunatly not in a
single method).
That alias generation should of course use the Dialect class which
would have an getMaxColumnNameLength and getMaxTableNameLength.
Does Hibernate do any checking on the length of the aliases it generates
when it creates it's SQL queries? I'm getting "identifier is too long"
errors against Oracle 9.2 at the moment because Hibernate tacks on some
extra text to some column names.
If not, would it be terribly difficult to add
Gavin King wrote:
The only caveat is that I implemented the writes
such that it
truncates the stream since that's the behavior I wanted.
Would you enlarge on this please? I'm not quite sure what
you're getting at
Say you have a Clob of length 10. If you're at position 4, and you
Matt Raible wrote:
I am trying to use Hibernate to connect to Oracle. I was using MySQL -
where everything worked. All I've changed (so far) was the tablename from
"user" to "cct_user". Now I'm getting the following error:
[junit] Testcase:
testGetUser(com.cable.comcast.dmc.itd.cct.persistenc
Gavin King wrote:
P.S. I've never figured out IIRC.
If I Remember Correctly.
-Mark
---
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP
Christian Bauer wrote:
On 20 Dec (17:37), Mark Woon wrote:
Have you considered using a filter to close the Session after everything
is rendered?
Yes, but closing/disconnecting the Session is _not_ the real problem.
The problem is: How and where does the Filter/Observer get and store the
Christian Bauer wrote:
While I'm at it: Another rework, or at least a discussion about it, for
2.0 would be the automatic reconnect of Sessions. You once mentioned
that in a forum post, but didn't like it.
My two cents:
If you've learned the basic concepts of O/R mapping, it's easy to produce
Gavin King wrote:
How are you planning on supporting this? Is there going to be some
internal changes in Hibernate to support them, or are you
just going to
add new Blob and Clob types?
There are two parts to this new functionality. Firstly, there is the
existing (in CVS) BlobType and C
Gavin King wrote:
Future plans:
Next release: 1.2.1
===
* various bugfixes
* full support for Clob and Blob
How are you planning on supporting this? Is there going to be some
internal changes in Hibernate to support them, or are you just going to
add new Blob and Clob types?
Jim Downing wrote:
Sorry for taking a tangent here but after spending a day trying to
figure out what SessionImpl was doing and to work out why my
bi-directional associations didn't work I conceded defeat and moved to
a unidirectional model.
How do you 'setparent/setchild on both ends'? Is guidanc
Gavin,
I see you've commited a Clob and Blob type! What's the status on them?
Are they working yet?
-Mark
---
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performanc
FYI,
The tree in CVS doesn't compile:
1) The TransactionManagerLookup interface implements
getUserTransactionName().
2) JTATransactionFactory has a bad variable name.
Attached patch fixes these problems.
-Mark
Index: cirrus/hibernate/transaction/JTATransactionFactory.java
Dave Johnson wrote:
This seems to indicate that the latest version of
Hibernate (1.2rc1) does not have support for CLOBs.
Is this true?
Believe so.
Without support for CLOBs is there any way use Hibernate
to persist fields longer than 255 characters? What type
should I use in my mapping file?
Gavin King wrote:
Yes, I *have* thought of that, but it seems so model intrusive
Not really in the spirit of the rest of our problem solutions
Part of the reason I'm not really considering this issue a show stopper is
that I really would prefer if people would use generated identi
The docs for the Lifecycle interface says:
onDelete - Called when an entity is deleted
onSave - Called when an entity is saved.
onUpdate - Called when an entity is passed to Session.update()
Does that mean that these methods are called _before_ the SQL action is
performed? onLoad specifically st
Gavin,
Out of curiosity, what made you decide to stop using trove4j? I only
discovered it because Hibernate required it, and have started using it
myself...
-Mark
---
This sf.net email is sponsored by: Influence the future
of Java(TM) tec
Well...
Adding CLOB support turned out to be much more complicated than I
thought. I'm not sure how much of my problems are due to the fact
thatI'm using Oracle vs. some other db but:
1) I was under the impression that I could just use my own Clob
implementation and call PreparedStatement.set
---
This sf.net emial is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
___
Gavin King wrote:
Yes! I like this idea a lotfully. Good thinking :)
Ok, unless someone else is working on this, I'm going to try to hammer
something out that'll handle Clobs nicely over the weekend. Any
advice/suggestions are more than welcome.
Gavin, I'm not really sure what you meant by a
Gavin,
I know I've reported that Hibernate works with CLOB's, but I'm afraid
that I was wrong. Hibernate persists Strings into CLOB columns
perfectly fine, but reading it out of the db yields a null. I've added
a new ClobType to handle CLOB columns to treat them as Strings. I've
attached a
Mark Woon wrote:
Here's the mapping I'm using for the set:
And if I change it to lazy="false," I get:
java.lang.NullPointerException
at cirrus.hibernate.LockMode.greaterThan(LockMode.java:30)
at cirrus.hibernate.impl.SessionImpl.lock(S
A few more details on the exception:
The session is still open when I try to access the lazily initialized
collection. The code is as simple as this:
Gene gene = (Gene)session.load(DbGene.class, "PA6222");
Set refSeqs = gene.getReferenceSequences();
Iterator it = refSeqs.iterato
Hi,
Can anyone tell me why I'm getting the following error? The error I get
with the current CVS build and the 1.1.4b build is different, but either
way, I still don't understand what the problem is.
Current CVS build:
Hibernate: SELECT Refer0.referenceSequenceId, Pharm1.pharmgkbAccessionId
Jon Lipsky wrote:
Hi,
All of the functionality is added and everything is checked into CVS. If
you find anything wrong, let me know, and I'll be glad to fix it.
Regarding your comment about Oracle 9 users wanting to use the ANSI style
joins. I know it would add more properties (to the already l
I'm getting this with both 1.1 and what's currently in CVS. I'm getting
an NPE at
cirrus.hibernate.helpers.ReflectHelper.get(ReflectHelper.java:169)
because target is null.
My mapping looks like this:
All I'm doing is:
Foo f = new Foo();
f.setId("I
Hi all...
I'm having a little problem trying to map my objects. My mapping looks
like this:
The db looks like this:
create table Foo ( fooId bigint not null primary key, discriminator
bigint not null, name varchar(256) )
create table FooBar (fooB
I seem to be having a problem with the element. It
works when the discriminator's type is "string," but not when it is
"integer." My mapping file looks like this:
And I'm getting the following error:
Sep 1, 2002 1:42:39 PM cirrus.hibernate.helpers.XMLHelpe
Gavin_King/[EMAIL PROTECTED] wrote:
This is now implemented as an optional attibute constrained="true|false" on
the element.
Don't you mean the element? Is constrained="false"
equivalent to the way it currently works (and I assume will remain the
default)?
Thanks,
-Mark
---
Gavin_King/[EMAIL PROTECTED] wrote:
So we should add something like:
and a matching
or something like that
That sounds perfect. Any chance of this happening in the near future?
I'm sort of at a dead end at the moment because of this. I was hoping
to use the Lifecycle interface t
Yaron Zakai wrote:
Hi,
On an earlier post, Gavin proposed to follow my proposal and make an API
modification
- there were no objections for that.
I would like to understand what is the next step. If there is an issue with
implementing
the change, I hereby volunteer to implement it. Assuming I
Hi all...
Is there a way for Hibernate to persist the parent before any children?
I've an object Foo which has a child Bar, and the mapping looks like this:
I'm having problems because Bar's id must be a foreign key into Foo.
Because Bar gets created before Foo, I get a
Hi all...
Can anyone tell me what Hibernate expects the db column type to be if I
specify type="boolean" in the mapping file?
Thanks,
-Mark
---
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for F
Gavin_King/[EMAIL PROTECTED] wrote:
Secondly, some people would like insert() to cascade to insert(). Whereas
other times insert() to save() is appropriate.
Which reminds me: what happens when I need insert() to cascade to
insert()? Is there some workaround?
-Mark
---
Hi all...
Can anyone tell me how a one-to-one mapping knows which row to pull to
instantiate the persistent object?
Thanks,
-Mark
---
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https
Gavin_King/[EMAIL PROTECTED] wrote:
What feature do you mean exactly with "normalized table mappings"?
Subcasses that map to diiffenent tables?
Yup. So you fetch the object using an outerjoin accross the table of the
superclass and the table of the subclass. This is the only remaining thing
t
56 matches
Mail list logo