You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Otávio Augusto <ot...@bol.com.br> on 2003/12/24 21:16:42 UTC

doubt

hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take the risk anyway. I imagine there are users who work with Struts and Hibernate, just like i do (i haven't found any hibernate's discussion list, so i'm posting this question here). is someone has ever had the "lazy instantiation" problem when working whith Struts + Hibernate, please, notice me.


Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: doubt

Posted by Mark Lowe <ma...@talk21.com>.
Hibernate throws that if it finds a null value on an indexed column.

Of example if you've a load of users and groups and say 3 users with 
group_id of 999 and then someone removes group 999 you'd get this 
exception.



On 24 Dec 2003, at 20:16, Otávio Augusto wrote:

> hi all
>
> Maybe this is an inapropriate place to ask that, but i'm gonna take 
> the risk anyway. I imagine there are users who work with Struts and 
> Hibernate, just like i do (i haven't found any hibernate's discussion 
> list, so i'm posting this question here). is someone has ever had the 
> "lazy instantiation" problem when working whith Struts + Hibernate, 
> please, notice me.
>
>
> Thanks a lot, and, again, pardon if that was not polite.
>
> Otávio Augusto
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: doubt

Posted by Otávio Augusto <ot...@bol.com.br>.
hi

the thing is: i have a bean called Setor, and this bean has an attribute called quadras, which is a collection. ok, i can retrieve the ben using hibernate, store it in a session (now talking about struts) and go to my jsp page. there, i have this piece of code:

<tr>
    <td><bean:write name="setores" property="nome" /></td><br><br>
    <td><bean:write name="setores" property="comentario" /></td><br>
  </tr>

<logic:iterate id="quad" name="setores" property="quadras">
  <tr>
    <td><bean:write name="quad" property="nome" /></td>
    <td><bean:write name="quad" property="comentario" /></td>
  </tr>
</logic:iterate>

Of course, the session was set this way: ("setores", setoresObj).
so, with the bean tag, i grab the "setores" bean, and print its non-collection attributes. then, i have to iterate over "quadras". is it the correct way? i've read hibernate's docs and noticed i can't get this collection values if the many-to-one association is a lazy one. how to get and iterate over this collection, then?

thanks for the attention

Otávio Augusto




On Wed, 24 Dec 2003 13:24:04 -0700
"David Erickson" <de...@cmcflex.com> wrote:

> What kind of problem are you referring to with lazy instantiation?  You can
> disable or enable it.. but if you have big lists of items that you may or
> may not use its good to leave it on..
> -David
> 
> ----- Original Message ----- 
> From: "Otávio Augusto" <ot...@bol.com.br>
> To: <st...@jakarta.apache.org>
> Sent: Wednesday, December 24, 2003 1:16 PM
> Subject: doubt
> 
> 
> hi all
> 
> Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
> anyway. I imagine there are users who work with Struts and Hibernate, just
> like i do (i haven't found any hibernate's discussion list, so i'm posting
> this question here). is someone has ever had the "lazy instantiation"
> problem when working whith Struts + Hibernate, please, notice me.
> 
> 
> Thanks a lot, and, again, pardon if that was not polite.
> 
> Otávio Augusto
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: doubt

Posted by David Erickson <de...@cmcflex.com>.
What kind of problem are you referring to with lazy instantiation?  You can
disable or enable it.. but if you have big lists of items that you may or
may not use its good to leave it on..
-David

----- Original Message ----- 
From: "Otávio Augusto" <ot...@bol.com.br>
To: <st...@jakarta.apache.org>
Sent: Wednesday, December 24, 2003 1:16 PM
Subject: doubt


hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
anyway. I imagine there are users who work with Struts and Hibernate, just
like i do (i haven't found any hibernate's discussion list, so i'm posting
this question here). is someone has ever had the "lazy instantiation"
problem when working whith Struts + Hibernate, please, notice me.


Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: doubt

Posted by Otávio Augusto <ot...@bol.com.br>.
Thanks a lot David. i've disabled lazy instantiation, and it is working now. but even for small tables and not many data, i feel the performance has decreased.

Thanks to all who helped ;)

Otávio Augusto


On Wed, 24 Dec 2003 15:54:09 -0500
"David Friedman" <hu...@ix.netcom.com> wrote:

> Otávio,
> 
> Hibernate discussions are at http://http://forum.hibernate.org.  A few of
> the discussion threads talk about Struts.  Many cover "lazy" instantiation.
> 
> Regards,
> David
> 
> -----Original Message-----
> From: Otávio Augusto [mailto:otavio.augusto@bol.com.br]
> Sent: Wednesday, December 24, 2003 3:17 PM
> To: struts-user@jakarta.apache.org
> Subject: doubt
> 
> 
> hi all
> 
> Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
> anyway. I imagine there are users who work with Struts and Hibernate, just
> like i do (i haven't found any hibernate's discussion list, so i'm posting
> this question here). is someone has ever had the "lazy instantiation"
> problem when working whith Struts + Hibernate, please, notice me.
> 
> 
> Thanks a lot, and, again, pardon if that was not polite.
> 
> Otávio Augusto
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: doubt

Posted by David Friedman <hu...@ix.netcom.com>.
Otávio,

Hibernate discussions are at http://http://forum.hibernate.org.  A few of
the discussion threads talk about Struts.  Many cover "lazy" instantiation.

Regards,
David

-----Original Message-----
From: Otávio Augusto [mailto:otavio.augusto@bol.com.br]
Sent: Wednesday, December 24, 2003 3:17 PM
To: struts-user@jakarta.apache.org
Subject: doubt


hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
anyway. I imagine there are users who work with Struts and Hibernate, just
like i do (i haven't found any hibernate's discussion list, so i'm posting
this question here). is someone has ever had the "lazy instantiation"
problem when working whith Struts + Hibernate, please, notice me.


Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org