Thank's Armin

I have been afraid for some long minutes but now it is OK. I use Pb on my side and it works OK.
I will ot move to JDO before JDO get stabilized on sun and ojb sides. So it's all good!


Best regards

Andre Legendre

Armin Waibel wrote:

Hi Andre,

A Leg wrote:

Hello

Does that mean that it is no way to get ojb work with Jboss ?


No, only the current JDO/Jdori based JDO-api implementation was not supported.
PB-api and ODMG-api work since 0.9x


Does that mean that it is no way to get ojb with any application server ?


No, don't panic! Same as above.


regards,
Armin

Excuse me with these questions but I was supposing it was working, but never try before ending my application.

Best regards

Andre Legendre

Armin Waibel wrote:

Hi Marco,

Marco Schulze wrote:

Hello!

I'm new to Apache OJB and I've the following problem: I'd like to use the JDO-API of OJB in EJBs within a JBoss-Server. Unfortunately, only two of the three supported APIs are registered in the JNDI:

- ojb/PBAPI
- ojb/defaultODMG




yes, currently it's not official support


JDO is not registered in JNDI. Thus, I can't look it up. What do I have to do?




you can try to write a similar mbean for jdo/jdori implementation, or you can use PM directly in code.


Anyway I tried to get JDO running within an EJB (stateful SessionBean) with the following code:


Product product = new Product();
product.setProductName("Notebook Fujitsu-Siemens");
product.setPrice(1333.99f);
PersistenceManager pm = pmFactory.getPersistenceManager();
Transaction tx = pm.currentTransaction();
tx.begin();
pm.makePersistent(product);
tx.commit();
pm.close();

The tx.begin() causes a java.lang.UnsupportedOperationException: Not supported in managed environment




In managed environments it's not allowed to start a local tx, only JTA UserTransaction are allowed.


If I don't do a tx.begin(), pm.makePersistent(...) causes a javax.jdo.JDOUserException: Transaction is not active.



I never tried to make to work in managed environments (e.g. OjbStoreConnector needs modification), because current implementation is only a prototype and we will start with the JDO implementation immediate after 1.0 release.


Thus you can use current JDO implementation only in beans without JTA transaction (means no distributed transactions) no cm-tx. So if you don't enable the org.apache.ojb.odmg.JTATxManager in OJB.properties you should be able to run JDO within a bean.

regards,
Armin

Can you please help me with a simple example bean and a short howto to register JDO in JNDI with JBoss?







Thousand thanks in advance!!!


Best regards, Marco ;-)


--------------------------------------------------------------------- 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]




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



Reply via email to