13 Temmuz 2010 Salı

Toplink and Glassfish

If you want to use toplink natively with Glassfish application server , you should make some configuration. First of all, you should change platform class for Glassfish like below, because SunAS9ServerPlatform class constructor expects DatabaseSessionImpl as argument, but it is called with DatabaseSession.


public SunAS9ServerPlatform(DatabaseSession newDatabaseSession) {

       super(newDatabaseSession);
}



Secondly, you should add below ines to your session.xml file.



<server-platform xsi:type="custom-platform">

<server-class>oracle.toplink.platform.server.sunas.SunAS9ServerPlatform</server-class>
<external-transaction-controller-class>oracle.toplink.transaction.sunas.SunAS9TransactionController</external-transaction-controller-class>
</server-platform>
 
 
As a final note, Toplink version is 11.1.1.0.1, Glassfish version is 3.0.1