Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] EM API Update -- unwrap(cls)

That's fine,  If always putting the UnitOfWork into an early transaction state and returning the connection is what is wanted then that's easy enough to do.  It must be noted that this will not provide an out of transaction connection and once called it has the side-effect of preventing usage of the shared cache. 
--Gordon

James Sutherland wrote:
Unwrapping to the Connection would be very very useful though.  This is a very common request, and should be easy to do in the JPA context, if there is an active uow/transaction, then call beginEarlyTransaction and return the connection, otherwise throw an error that it must be in a transaction.


----- Original Message -----
From: "Gordon Yorke" <GORDON.YORKE@xxxxxxxxxx>
To: "Eclipselink-Dev" <eclipselink-dev@xxxxxxxxxxx>
Sent: Thursday, December 18, 2008 11:40:02 AM (GMT-0500) America/New_York
Subject: Re: [eclipselink-dev] EM API Update -- unwrap(cls)

I agree with providing unwrapping of the ServerSession but unwrapping the connection is a much more complicated feature with quite a few functional decisions to be made and evaluated (ie, what connection do users really want (force transactional or the one eclipselink is using), what side-effects are there to the chosen behaviour, etc..).  I recommend filing an enhancement request to unwrap the connection and deferring to a later date.
--Gordon

Michael Keith wrote:
Hi Darani,

One obvious one would be a shortcut to obtain the ServerSession without
having to name it in a property and go through the SessionManager.

Another very useful use of "unwrap" would be to return the underlying 
javax.sql.Connection. A number of folks want to have access to the connection
for very specialized cases. We would need to decide whether calling unwrap for
a Connection would cause one to be allocated if it has not already been,
and there are a few issues associated with that, etc. but it would be worth
looking at.

-Mike

  
-----Original Message-----
From: Darani Yallapragada [mailto:Darani.Yallapragada@xxxxxxx]
Sent: Tuesday, December 16, 2008 3:04 PM
To: Dev mailing list for Eclipse Persistence Services
Subject: [eclipselink-dev] EM API Update -- unwrap(cls)


Hello :

I am currently working on implementing the following method :

public <T> T unwrap(Class<T> cls);

I can think of "UnitOfWork" and "JpaEntityManager" classes 
that should 
be unwrapped.

Are there any other classes that should be unwrapped ?

Thank You

Regards
Darani


_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

    
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
  

_______________________________________________ eclipselink-dev mailing list eclipselink-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

Back to the top