Session factory or also an open session?

**
Martin

2010/7/24 Sam Barrow <s...@sambarrow.com>:
> getClientModel gets an instance of EntityModel which contains a
> reference to a repository and an id. The repository has a reference to
> the hibernate SessionFactory.
>
> On Sat, 2010-07-24 at 12:20 +0300, Martin Makundi wrote:
>> Hi!
>>
>> If I understand correctly, getClientModelObject() will need a session.
>> Is that a problem?
>>
>> **
>> Martin
>>
>> 2010/7/24 Sam Barrow <s...@sambarrow.com>:
>> > It's just a billing system. The problem comes up now in very simple use
>> > cases.
>> >
>> > Currently all we're doing is trying to load a collection with a list of
>> > Order domain objects from the Client domain object.
>> >
>> > final SortableDataProvider<Order> provider = new
>> > RepositoryDataProvider<Order>(getOrderRepository()) {
>> >                       �...@override
>> >                        protected List<Order> load() {
>> >                                return new 
>> > ArrayList<Order>(getClientModelObject().getOrders());
>> >                        }
>> >                };
>> >
>> >
>> > On Sat, 2010-07-24 at 12:07 +0300, Martin Makundi wrote:
>> >> It's difficult to comment exactly not knowing the actual use case and
>> >> background.. but maybe another design approach would help?
>> >>
>> >> And also it's just my opinnion to try to avoid lazy initialization in
>> >> GUI. Somebody might disagree ;]
>> >>
>> >> **
>> >> Martin
>> >>
>> >> 2010/7/24 Sam Barrow <s...@sambarrow.com>:
>> >> > The only alternative I've found is DTOs, which would not be practical at
>> >> > all, we have a very large domain model.
>> >> >
>> >> > On Sat, 2010-07-24 at 11:58 +0300, Martin Makundi wrote:
>> >> >> I would avoid using lazy entities in GUI.
>> >> >>
>> >> >> **
>> >> >> Martin
>> >> >>
>> >> >> 2010/7/24 Sam Barrow <s...@sambarrow.com>:
>> >> >> > The entitymodel accesses a generic repository implementation. So I 
>> >> >> > would
>> >> >> > definitely need to use open session in view to avoid these?
>> >> >> >
>> >> >> > On Sat, 2010-07-24 at 11:29 +0300, Martin Makundi wrote:
>> >> >> >> I would recommend against making your GUI dependent on persistence 
>> >> >> >> container...
>> >> >> >>
>> >> >> >> ...but yes you will need active database connection for lazy 
>> >> >> >> loading entities.
>> >> >> >>
>> >> >> >> **
>> >> >> >> Martin
>> >> >> >>
>> >> >> >> 2010/7/24 Sam Barrow <s...@sambarrow.com>:
>> >> >> >> > I'm getting hibernate lazy initialization exceptions. I was under 
>> >> >> >> > the
>> >> >> >> > impression that a smart entity model would fix this
>> >> >> >> > (http://wicketinaction.com/2008/09/building-a-smart-entitymodel/) 
>> >> >> >> > is
>> >> >> >> > that true? Or do i need opensessioninview as well?
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > ---------------------------------------------------------------------
>> >> >> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> >> >> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >> >> >
>> >> >> >> >
>> >> >> >>
>> >> >> >> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> >> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > ---------------------------------------------------------------------
>> >> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> >> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to