Re: Does OJB supports Geronimo?

2006-11-09 Thread Andreas Bohnert
hello armin,

sorry for the late reply and thank you for your help!
I  had to skip the managed transactions and use the normal
PersistenceBrokerImpl.
However I have tried your suggestion and failed
got a: org.apache.ojb.broker.PBFactoryException: Can't instantiate
TransactionManager of managed environment
with not further details.

andreas

Armin Waibel schrieb:
 Hi Andreas,

 Andreas Bohnert wrote:
 hi,

 I wonder if OJB supports Geronimo. I haven't found an TransactionManager
 in /org/apache/ojb/broker/transaction/tm, also I haven't found any
 geronimo topics in the mailing list or the documentation.

 Are there any Geronimo users here?

 I try to migrate from jboss to geronimo, but now I'm doubtful, if I will
 be sucessful, if there is no transactionmager to use ...


 Sorry Geronimo support is on my todo-list, but it slipped my mind.

 To implement the TransactionManagerFactory I this document about
 JBoss/Hibernate migration (scroll down to
 GeronimoTransactionManagerLookup)
 http://cwiki.apache.org/GMOxDOC10/jboss-to-geronimo-hibernate-migration.html


 The OJB version (compatible with current sources) will look like this:

 public class GeronimoTransactionManagerFactory implements
 TransactionManagerFactory
 {
 public static final String
 TransactionMgrGBeanName=geronimo.server:J2EEApplication=null, +

 J2EEModule=geronimo/j2ee-server/1.0/car,J2EEServer=geronimo,j2eeType=TransactionManager,
 +
 name=TransactionManager;

 private TransactionManager tm;

 public TransactionManager getTransactionManager() throws
 TransactionManagerFactoryException
 {
 if(tm == null)
 {
 tm = lookupManager();
 }
 return tm;
 }

 private TransactionManager lookupManager() throws
 TransactionManagerFactoryException
 {
 try
 {
 Class kernelClass =
 ClassHelper.getClass(org.apache.geronimo.kernel.Kernel);
 Class kernelRegistryClass =
 ClassHelper.getClass(org.apache.geronimo.kernel.KernelRegistry);
 Class proxyManagerClass =
 ClassHelper.getClass(org.apache.geronimo.kernel.proxy.ProxyManager);
 Class objectNameClass =
 ClassHelper.getClass(javax.management.ObjectName);

 Object transactionManagerName = ClassHelper.newInstance(
 objectNameClass, String.class,
 TransactionMgrGBeanName);
 Object kernel =
 kernelRegistryClass.getMethod(getSingleKernel, null).invoke(null,
 null);
 Object proxyManager =
 kernelClass.getMethod(getProxyManager, null).invoke(kernel, null);
 Class[] clzArray = {objectNameClass, Class.class};
 Object[] objArray = {transactionManagerName,
 TransactionManager.class};
 return (TransactionManager)
 proxyManagerClass.getMethod(createProxy, clzArray)
 .invoke(proxyManager, objArray);

 }
 catch(Exception e)
 {
 throw new TransactionManagerFactoryException(Geronimo
 Transaction Manager Lookup Failed, e);
 }
 }
 }

 It would be great if you could check this class.

 regards,
 Armin


 Thanks for your help,
 andreas


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Does OJB supports Geronimo?

2006-10-13 Thread Andreas Bohnert
hi,

I wonder if OJB supports Geronimo. I haven't found an TransactionManager
in /org/apache/ojb/broker/transaction/tm, also I haven't found any
geronimo topics in the mailing list or the documentation.

Are there any Geronimo users here?

I try to migrate from jboss to geronimo, but now I'm doubtful, if I will
be sucessful, if there is no transactionmager to use ...

Thanks for your help,
andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does OJB supports Geronimo?

2006-10-13 Thread Armin Waibel

Hi Andreas,

Andreas Bohnert wrote:

hi,

I wonder if OJB supports Geronimo. I haven't found an TransactionManager
in /org/apache/ojb/broker/transaction/tm, also I haven't found any
geronimo topics in the mailing list or the documentation.

Are there any Geronimo users here?

I try to migrate from jboss to geronimo, but now I'm doubtful, if I will
be sucessful, if there is no transactionmager to use ...



Sorry Geronimo support is on my todo-list, but it slipped my mind.

To implement the TransactionManagerFactory I this document about 
JBoss/Hibernate migration (scroll down to GeronimoTransactionManagerLookup)

http://cwiki.apache.org/GMOxDOC10/jboss-to-geronimo-hibernate-migration.html

The OJB version (compatible with current sources) will look like this:

public class GeronimoTransactionManagerFactory implements 
TransactionManagerFactory

{
public static final String 
TransactionMgrGBeanName=geronimo.server:J2EEApplication=null, +


J2EEModule=geronimo/j2ee-server/1.0/car,J2EEServer=geronimo,j2eeType=TransactionManager, 
+

name=TransactionManager;

private TransactionManager tm;

public TransactionManager getTransactionManager() throws 
TransactionManagerFactoryException

{
if(tm == null)
{
tm = lookupManager();
}
return tm;
}

private TransactionManager lookupManager() throws 
TransactionManagerFactoryException

{
try
{
Class kernelClass = 
ClassHelper.getClass(org.apache.geronimo.kernel.Kernel);
Class kernelRegistryClass = 
ClassHelper.getClass(org.apache.geronimo.kernel.KernelRegistry);
Class proxyManagerClass = 
ClassHelper.getClass(org.apache.geronimo.kernel.proxy.ProxyManager);
Class objectNameClass = 
ClassHelper.getClass(javax.management.ObjectName);


Object transactionManagerName = ClassHelper.newInstance(
objectNameClass, String.class, 
TransactionMgrGBeanName);
Object kernel = 
kernelRegistryClass.getMethod(getSingleKernel, null).invoke(null, null);
Object proxyManager = 
kernelClass.getMethod(getProxyManager, null).invoke(kernel, null);

Class[] clzArray = {objectNameClass, Class.class};
Object[] objArray = {transactionManagerName, 
TransactionManager.class};
return (TransactionManager) 
proxyManagerClass.getMethod(createProxy, clzArray)

.invoke(proxyManager, objArray);

}
catch(Exception e)
{
throw new TransactionManagerFactoryException(Geronimo 
Transaction Manager Lookup Failed, e);

}
}
}

It would be great if you could check this class.

regards,
Armin



Thanks for your help,
andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]