>>> The other problem and perhaps Gavin has some input on this, is that
when you make use of the proxy feature, it appears that the proxy
keeps a refernce to the session that was used to create that proxy.
So if the connection is getting closed between SB calls this proxy
object fails when passed to a second SB. This is a bit of a dilemma
for me as the proxy would greatly impact performace of my system
(the only other solution is to stop using the one to one mapping
and return id values of these colums instead, not very object). <<

huh? what is the problem here? It is just like passing objects back to the
web tier, right??

You call Hibernate.initialize(), of whatever else to initialize the proxy
first, before passing it on....

I guess, we *could* implement ThreadLocalSession internally in Hibernate so
that proxies and lazy collections _automatically_ pick up a reference to
the current Session. But I've so far resisted this design. It doesn't work
too well for collections, since they can't be reassociated with a new
Session without their current owner also being reassociated. And there is
no way to implement a backpointer from the collection to its owner.




|---------+------------------------------------------->
|         |           Andy Britz                      |
|         |           <[EMAIL PROTECTED]>          |
|         |           Sent by:                        |
|         |           [EMAIL PROTECTED]|
|         |           ceforge.net                     |
|         |                                           |
|         |                                           |
|         |           05/08/03 05:27 PM               |
|         |           Please respond to andy          |
|         |                                           |
|---------+------------------------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                          |
  |       To:       [EMAIL PROTECTED]                                                  
                      |
  |       cc:                                                                          
                                          |
  |       Subject:  Re: [Hibernate] JCA RollBack                                       
                                          |
  
>------------------------------------------------------------------------------------------------------------------------------|




Hi Igor

Thanks for the quick response. I will try and use the solution you
suggested. Hopefully this will solve the transaction and update problems
with loaded objects.

The other problem and perhaps Gavin has some input on this, is that
when you make use of the proxy feature, it appears that the proxy
keeps a refernce to the session that was used to create that proxy.
So if the connection is getting closed between SB calls this proxy
object fails when passed to a second SB. This is a bit of a dilemma
for me as the proxy would greatly impact performace of my system
(the only other solution is to stop using the one to one mapping
and return id values of these colums instead, not very object).

So I can only figure out two senarios that solve this

1. if it is impossible to use the thread local pattern, I need a
proxy that gets a handle to a new session everytime it tries a lazy
load.

2. I need hibenrate to control its own DB connections so that I can
use a thread local pattern.

Once again any input would be most apreciated
regards
Andy


At Monday, 04 August 2003, Igor Fedorenko <[EMAIL PROTECTED]> wrote:

>Andy,
>
>It's been a while sinse I last looked at this code but as far as I
>remember there was a way to force JBoss to use the same JCA connection
>to be used by multiple EJBs participating in the same transaction (if
>this is what you want). If I am not mistaken, you should specify
>ejb-resource-ref/Sharable in ejb-jar.xml and track-connection-by-tx (or
>something like this) in hibernate-ds.xml file. If you did that, JBoss
>would use the same HibernateSession instance throughout entire
>transaction so you don't need to implement you own ThreadLocal. The
>problem with this approach is that generally speaking you cannot
>guarantee that all EJBs are deployed in one JVM (you can have a
cluster,
>for example).
>
>Andy Britz wrote:
>> Hi guys, this mail is aimed mainly at Daniel and Igor as I understand
>> they are responsible for the JCA implementation
>>
>> I would like to get some information regarding the JCA adapter and
>> request a possible rollback to an earlier implementation provided
>> by Daniel.
>>
>> Here is a Scenario (mine actually), many different local Session
>> beans in JBoss. All attempting to share a session using the ThreadLocal

>> pattern. The reason for this is an attempt to use the lazy loading
>> and proxy features provided by Hibernate.
>>
>> As far as I can tell this fails because the JBoss server guarantees
>> all transactions across a group of session beans participate in the
>> transaction, but does not guarantee that the same resources such
>> as Database connections are shared. In fact I am pretty confident
>> that one of the stateless session bean Interceptors in JBoss closes
>> the Database connections between session bean calls as it assumes
>> that you have left the connection open if it is not closed. Goodbye
>> to passing lazy loading proxy objects around as the connection
beneath
>> the Hibernate Session has been closed.
>>
>> So my request is that we reinstate, or at least provide a means by
>> with Hibernate can manage its own connection pool to the database.
>>
>>
>> If I have misunderstood anything or there is an easier way around
>> the problem please let me know.
>>
>> regards
>> Andy
>>
>> p.s. If you guys agree with my assessment I would also be happy to
>> try and add support to the JCA implementation for managing its own
>> connections.
>>
>>
>>
>>
>> ===================================================================
>>           Brought to you by: http://www.read-it.co.za/
>> ===================================================================
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>> Data Reports, E-commerce, Portals, and Forums are available now.
>> Download today and enter to win an XBOX or Visual Studio .NET.
>>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>> _______________________________________________
>> hibernate-devel mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

>_______________________________________________
>hibernate-devel mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>



===================================================================
          Brought to you by: http://www.read-it.co.za/
===================================================================




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**********************************************************************
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**********************************************************************






-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to