RE: [Hibernate] Obtaining session in a filter

2003-01-29 Thread Schnitzer, Jeff
> From: Raible, Matt [mailto:[EMAIL PROTECTED] > > BTW - your filter complains about setting a static variable > from a non-static context: this.factory = > (SessionFactory)ctx.lookup(factoryJndiName); Right - that's deliberate. You don't want to create a new InitialContext and perform a JNDI lo

RE: [Hibernate] Obtaining session in a filter

2003-01-29 Thread Raible, Matt
Jeff, Thanks for adding your filter to the wiki. However, I'm looking for an even simpler solution. I'd like to use Thread Local Session (http://hibernate.bluemars.net/42.html) in combination with a Filter, so I can still obtain sessions in my JUnit tests, and I'm not duplicating code in the web

[Hibernate] what does "readonly=true" mean in a bidirectional association?

2003-01-29 Thread jiesheng zhang
Use the example from hibernate-reference manual: Here the children set in the Parent object is readonly. Does it mean any modification to any "Child element" in the Children set will not be persisted to database( an violation of usual persistence by reachability

[Hibernate] bidirection relationship trouble

2003-01-29 Thread Владимир
Hello. How bidirection relationship can be used without readonly attribute on any side, in opposite case (with using cirrus.hibernate.tools.SchemaExport) two foreign keys on "many" side were generated?

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Gavin . King
Note also that there are actually some *advantages* to a . We can add to a bag without initializing it. So if you are mostly adding, a bag will be faster. If you are mostly updating or removing, it will be slower. > Note also that s cannot add and remove elements > individually (this makes perfe

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Viktor Szathmary
On Wed, 29 Jan 2003 17:18:29 +1100, [EMAIL PROTECTED] said: > > > ok, this is just the good old nanosecond issue again. (btw, when is the > > next release coming, that has that fix? :) > > In about two hours. that's great! > > however, previously (when the whole thing was mapped as Subscription

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Gavin . King
> ok, this is just the good old nanosecond issue again. (btw, when is the > next release coming, that has that fix? :) In about two hours. > however, previously (when the whole thing was mapped as Subscription 1-1 > Feed 1-n Item) this resulted in an extra update, not a delete/insert.. > why is

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Gavin . King
Not 100% sure why, but heres two possibilities: (1) Does Feed implement equals() and hashode() correctly? I actually forget if that affects the behaviour of a bag. (2) Did you change an Item after saving the Subscription? For a bag that would cause a delete then insert, instead of an update (a

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Viktor Szathmary
On Wed, 29 Jan 2003 00:57:42 -0500, "Viktor Szathmary" <[EMAIL PROTECTED]> said: > > however, apparently this is less efficient than a regular one-to-many > was: even upon the first save(..) it generates: > INSERT INTO Subscription ... > INSERT INTO Item ... > DELETE FROM Item ... > INSERT INTO It

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Gavin . King
What on earth is the doing there? Feed is a component class . Just remove the I'm glad you noticed the element. I never saw anyone else use that before ;)

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Gavin . King
The firstclass object may refer to the object that owns the component. But no, you can't do something like "Viktor Szathmary"

Re: [Hibernate] ... and how about bidirectional for a component? :)

2003-01-29 Thread Viktor Szathmary
On Wed, 29 Jan 2003 00:06:38 -0500, "Viktor Szathmary" <[EMAIL PROTECTED]> said: > hi, > > to annoy people with more trivial questions: is it possible to have a > bidirectional one-to-many relationship between a component and a > firstclass object? i'm getting a MappingException: "An association r

Re: [Hibernate] dependent object with map

2003-01-29 Thread Viktor Szathmary
hi, On Wed, 29 Jan 2003 15:30:40 +1100, [EMAIL PROTECTED] said: > > Use a mapping. (or a custom type) > duh.. for some reason i thought i remembered reading in the docs, that hibernate doesn't support collections inside components... i'm getting senile i guess. thx, viktor -- http://fastma

Re: [Hibernate] dependent object with map

2003-01-29 Thread Gavin . King
Use a mapping. (or a custom type) "Viktor Szathmary"

[Hibernate] dependent object with map

2003-01-29 Thread Viktor Szathmary
hi, suppose i have a class Foo, that has a single Bar property. Bar is just a convenience wrapper around a Map (doesn't implement Map). How can one map this sort of relationship, without making Bar a first class object with it's own identity (and therefore 3 tables instead of the two it really nee

[Hibernate] Obtaining session in a filter

2003-01-29 Thread Raible, Matt
I'm trying to migrate my app to use a Session at the UI level, and to pass this session down to my services and persistence layers. In my Filter, I'm basically calling a HibernateSession class which looks like the ThreadLocal pattern from the design patterns on the wiki. Below is my doFilter meth