Re: Object with links to objects from a different database

2004-08-06 Thread Armin Waibel
Hi Ian,
Ian Hunter wrote:
I have a system that uses one database for storing 95% of it's data, but 5%
of it lives in a separate ERP that I'm linking to.  OJB is talking to both
databases just fine, but when I try to load an object that has auto-retrieve
turned on that also happens to reference an object in a different database,
OJB can't figure out that the subobject lives elsewhere and tries to
access its table in the current database.
OJB doesn't support materialization of objects made up of different DB. 
There is a feature request to support this but I don't like it, because 
of the complications on insert/update/delete of these composed objects 
(in that case need a 'OJB internal' distributed transaction support to 
guarantee synchronization of databases).

So you have to handle this stuff by your own using a thin layer on top 
of OJB. Here a simple example how you can handle this:

broker_1 --- DB_1
broker_2 --- DB_2
MyObject composed = (MyObject) broker_1.getObjectByIdentity(oid);
broker_2.retrieveReference(composed, refFieldNameToLoadFromDB_2);
That's all! Now the object should have data from DB_1 and the reference 
read from DB_2.

regards,
Armin
Help?!?!
---
Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht
oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist
and lsat ltteer be at the rghit pclae. The rset can be a total mses and you
can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not
raed ervey lteter by istlef, but the wrod as a wlohe.
-
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]


Re: ReferenceDescriptor

2004-08-06 Thread Armin Waibel
Claudio Romano wrote:
If i have a Product associated 1:1 with an Special and it is modeled in the
db such that the special table has a product_id (not primarykey!)... is
there a way to map the Special with a ReferenceDescriptor in to the Product?
well this sounds as Product has a 1:n relation with Special, because 
Special has an Product FK (product_id) and the Special has an 1:1 
relation to Product. The FK 'product_id' have to represent the PK of 
Product.
So you can declare a collection-descriptor in Product and an 
reference-descriptor in Special.

regards,
Armin
thx
Claudio
-
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]


Re: Stale information in Cache when Inserting w/ 1:N's

2004-08-06 Thread Armin Waibel
Hi Paul,
I assume you use ObjectCacheDefaultImpl for object caching. This 
implementation is really simple and cache complete object graph (object 
with all dependencies). So if you add a new book and lookup the library 
object from OJB, the library will be found in cache, therefore the 
cached books in the library object will not be updated - until the 
cached library is timed out or removed from cache.

If you don't want this behavior you can change the used ObjectCache 
implementation, e.g. use ObjectCachePerBrokerImpl. Or easiest way, set 
the 'refresh' attribute of the library class collection-descriptor to 
'true'.

http://db.apache.org/ojb/docu/guides/repository.html#collection-descriptor-N1059C
regards,
Armin

Paul Timmins wrote:
When I add an object on the one side of a 1:N relationship (ie: adding 
a book), the cached many (ie: a library) side is out of synch.

In pseudocode:
1. Access Library 1 and count the number of books (it's now cached)
2. Create a new book, set the book.library_id=1
3. PersistenceBroker.store(book) (book is now inserted)
4. Count the number of books in Library 1
Problem! In step 4, the number of books has not been updated... it's 
the cached value from step 1, not the correct value.

What is the proper way to deal with this issue? Are we supposed to 
flush the cache on every write? Or, manually update all the related 
objects? Or what?

PS: In step 2, I could set the book.library object instead of the FK. 
Same result.


Scenario:
Let's say I have two tables Library and Book, with a FK to Library 
in Book (therefore, this is a 1:N from Library to books)

Data objects:
public class Library {
 Integer id; // PK
 Collection books; // lazy loaded (Proxy=true)
}
public class Book {
 Integer id;
 Integer library_id; // FK to Library
 Library library;
}
Repository_User.xml:
class-descriptor
 class=Book
 table=book
 field-descriptor
name=id
column=id
jdbc-type=INTEGER
primarykey=true
autoincrement=true
sequence-name=bookid
 /
 field-descriptor
name=library_id
column=library_id
jdbc-type=INTEGER
 /
 field-descriptor
name=name
column=name
jdbc-type=VARCHAR
 /
 reference-descriptor
   name=Library
   class-ref=library
   auto-retrieve=true
   auto-update=link
   auto-delete=false
   foreignkey field-ref=library_id /
 /reference-descriptor
/class-descriptor
class-descriptor
 class=Library
 table=library
 field-descriptor
name=id
column=id
jdbc-type=INTEGER
primarykey=true
autoincrement=true
sequence-name=libraryid
 /
 field-descriptor
name=name
column=name
jdbc-type=VARCHAR
 /
 collection-descriptor
   name=collbooks
   element-class-ref=Book
   auto-retrieve=true
   auto-update=link
   auto-delete=false
   proxy=false
   inverse-foreignkey field-ref=library_id/
 /collection-descriptor
/class-descriptor
_
Express yourself instantly with MSN Messenger! Download today - it's 
FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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


Problems with TM in ejbCreate()

2004-08-06 Thread =?iso-8859-1?q?Dino=20Di=20Cola?=
Dear all,
I encountered some problems with Transaction
Management porting my J2EE application from Ora9ias
9.0.2 to Ora9ias 9.0.3 platform.
I tried to reproduce the problem with a simple J2EE
application made up of a test stateless session bean
with a single business method.
This very simple J2EE application is deployed
successfully both in Ora9ias 9.0.2 and Ora9ias 9.0.3.
The business method (test_odmg()) can be successfully
invoked by a RMI client on the Ora9ias 9.0.2
deployment.
On the Ora9ias 9.0.3 deployment however I get the
following error:

The following exception has been catched: Error in
ejbCreate(): No external transaction found; nested
exception is:
org.odmg.TransactionNotInProgressException: No
external transaction found
com.evermind.server.rmi.OrionRemoteException: Error
in ejbCreate(): No external transaction found
at
com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:267)
at
OJBTest_ODMG_StatelessSessionBeanWrapper52.test_odmg(OJBTest_ODMG_StatelessSessionBeanWrapper52.java:83)
at java.lang.reflect.Method.invoke(Native
Method)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:479)
at connection to c99-012.prirm.pride.it/10.2.21.8 as
admin
at
com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1558)
at
com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1511)
at
com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:55)
at
com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
at
com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:50)
at __Proxy4.test_odmg(Unknown Source)
at
it.enidata.psv.ejb.client.TestOJB_ODMG.main(TestOJB_ODMG.java:45)

Nested exception is:
org.odmg.TransactionNotInProgressException: No
external transaction found
at
org.apache.ojb.odmg.JTATxManager.registerTx(Unknown
Source)
at
org.apache.ojb.odmg.TransactionImpl.begin(Unknown
Source)
at
org.apache.ojb.odmg.ImplementationJTAImpl.beginInternTransaction(Unknown
Source)
at
org.apache.ojb.odmg.ImplementationJTAImpl.registerOpenDatabase(Unknown
Source)
at
org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
at
it.enidata.psv.ejb.account.OJBTest_ODMGBean.init(OJBTest_ODMGBean.java:99)
at
it.enidata.psv.ejb.account.OJBTest_ODMGBean.ejbCreate(OJBTest_ODMGBean.java:41)
at
OJBTest_ODMGHome_StatelessSessionHomeWrapper53.callCreate(OJBTest_ODMGHome_StatelessSessionHomeWrapper53.java:145)
at
com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:254)
at
OJBTest_ODMG_StatelessSessionBeanWrapper52.test_odmg(OJBTest_ODMG_StatelessSessionBeanWrapper52.java:83)
at java.lang.reflect.Method.invoke(Native
Method)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:479)
at connection to c99-012.prirm.pride.it/10.2.21.8
at
com.evermind.server.rmi.OrionRemoteException.receive(OrionRemoteException.java:130)
at
com.evermind.server.rmi.RMIConnection.handleMethodInvocationResponse(RMIConnection.java:1673)
at
com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:532)
at
com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:275)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
at java.lang.Thread.run(Thread.java:484)

The error arises in the ejbCreate() as soon as the
db.open() is invoked. 
- If I move the OJB initialization into the business
method (leaving the EJB as stateless) the error
disappears.
- If I change the deployment descriptor from
stateless to stateful (leaving the OJB
initialization into the ejbCreate()) the error
disappears.
What is the rationale behind this behaviour?

Here below you will find 
- the source code of the test session bean
- the deployment descriptor
- the OJB.properties

Any assitance in the matter would be great. 
Thanks in advance.

Regards,


Dino.
--

***
 Source code for the session bean
*
***
public class OJBTest_ODMGBean implements SessionBean {


Problems with Transaction Management in ejbCreate()

2004-08-06 Thread Dino
Dear all,
I encountered some problems with Transaction Management porting my J2EE 
application from Ora9ias 9.0.2 to Ora9ias 9.0.3 platform.
I tried to reproduce the problem with a simple J2EE application made up of a 
test stateless session bean with a single business method.
This very simple J2EE application is deployed successfully both in Ora9ias 
9.0.2 and Ora9ias 9.0.3.
The business method (test_odmg()) can be successfully invoked by a RMI client 
on the Ora9ias 9.0.2 deployment.
On the Ora9ias 9.0.3 deployment however I get the following error:

The following exception has been catched: Error in ejbCreate(): No external 
transaction found; nested exception is:
org.odmg.TransactionNotInProgressException: No external transaction 
found
com.evermind.server.rmi.OrionRemoteException: Error in ejbCreate(): No 
external transaction found
at com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance
(StatelessSessionEJBHome.java:267)
at OJBTest_ODMG_StatelessSessionBeanWrapper52.test_odmg
(OJBTest_ODMG_StatelessSessionBeanWrapper52.java:83)
at java.lang.reflect.Method.invoke(Native Method)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:479)
at connection to c99-012.prirm.pride.it/10.2.21.8 as admin
at 
com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERV
ER(RMIConnection.java:1558)
at com.evermind.server.rmi.RMIConnection.invokeMethod
(RMIConnection.java:1511)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke
(RemoteInvocationHandler.java:55)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke
(RecoverableRemoteInvocationHandler.java:22)
at 
com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke
(StatelessSessionRemoteInvocationHandler.java:50)
at __Proxy4.test_odmg(Unknown Source)
at it.enidata.psv.ejb.client.TestOJB_ODMG.main(TestOJB_ODMG.java:45)

Nested exception is:
org.odmg.TransactionNotInProgressException: No external transaction 
found
at org.apache.ojb.odmg.JTATxManager.registerTx(Unknown Source)
at org.apache.ojb.odmg.TransactionImpl.begin(Unknown Source)
at org.apache.ojb.odmg.ImplementationJTAImpl.beginInternTransaction
(Unknown Source)
at org.apache.ojb.odmg.ImplementationJTAImpl.registerOpenDatabase
(Unknown Source)
at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
at it.enidata.psv.ejb.account.OJBTest_ODMGBean.init
(OJBTest_ODMGBean.java:99)
at it.enidata.psv.ejb.account.OJBTest_ODMGBean.ejbCreate
(OJBTest_ODMGBean.java:41)
at OJBTest_ODMGHome_StatelessSessionHomeWrapper53.callCreate
(OJBTest_ODMGHome_StatelessSessionHomeWrapper53.java:145)
at com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance
(StatelessSessionEJBHome.java:254)
at OJBTest_ODMG_StatelessSessionBeanWrapper52.test_odmg
(OJBTest_ODMG_StatelessSessionBeanWrapper52.java:83)
at java.lang.reflect.Method.invoke(Native Method)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:479)
at connection to c99-012.prirm.pride.it/10.2.21.8
at com.evermind.server.rmi.OrionRemoteException.receive
(OrionRemoteException.java:130)
at com.evermind.server.rmi.RMIConnection.handleMethodInvocationResponse
(RMIConnection.java:1673)
at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:532)
at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:275)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
(PooledExecutor.java:797)
at java.lang.Thread.run(Thread.java:484)

The error arises in the ejbCreate() as soon as the db.open() is invoked. 
- If I move the OJB initialization into the business method (leaving the EJB 
as stateless) the error disappears.
- If I change the deployment descriptor from stateless to stateful 
(leaving the OJB initialization into the ejbCreate()) the error disappears.
What is the rationale behind this behaviour?

Here below you will find 
- the source code of the test session bean
- the deployment descriptor
- the OJB.properties

Any assitance in the matter would be great. 
Thanks in advance.

Regards,


Dino.
--

***
 Source code for the session bean *
***
public class OJBTest_ODMGBean 

RE: ReferenceDescriptor

2004-08-06 Thread Claudio Romano
Thanx,

this is what i currenty doing, i just hopped for 
reference-descriptor in product solution. So i
could get easier the products specials in my
product, as i now that there is only one special
per product.

Claudio


 -Original Message-
 From: Armin Waibel [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 06, 2004 10:58 AM
 To: OJB Users List
 Subject: Re: ReferenceDescriptor
 
 
 Claudio Romano wrote:
  If i have a Product associated 1:1 with an Special and it 
 is modeled in the
  db such that the special table has a product_id (not 
 primarykey!)... is
  there a way to map the Special with a ReferenceDescriptor 
 in to the Product?
 
 
 well this sounds as Product has a 1:n relation with Special, because 
 Special has an Product FK (product_id) and the Special has an 1:1 
 relation to Product. The FK 'product_id' have to represent the PK of 
 Product.
 So you can declare a collection-descriptor in Product and an 
 reference-descriptor in Special.
 
 regards,
 Armin
 
  thx
  Claudio
  
  
  
 -
  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]



Re: ReferenceDescriptor

2004-08-06 Thread Armin Waibel
Claudio Romano wrote:
Thanx,
this is what i currenty doing, i just hopped for 
reference-descriptor in product solution. So i
could get easier the products specials in my
product, as i now that there is only one special
per product.

To use a reference-descriptor in Product (1:1 relation to Special) you 
need a FK to Special in Product table (special_id).

regards,
Armin
Claudio

-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 06, 2004 10:58 AM
To: OJB Users List
Subject: Re: ReferenceDescriptor

Claudio Romano wrote:
If i have a Product associated 1:1 with an Special and it 
is modeled in the
db such that the special table has a product_id (not 
primarykey!)... is
there a way to map the Special with a ReferenceDescriptor 
in to the Product?
well this sounds as Product has a 1:n relation with Special, because 
Special has an Product FK (product_id) and the Special has an 1:1 
relation to Product. The FK 'product_id' have to represent the PK of 
Product.
So you can declare a collection-descriptor in Product and an 
reference-descriptor in Special.

regards,
Armin

thx
Claudio

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


Re: Problems with TM in ejbCreate()

2004-08-06 Thread Armin Waibel
Hi Dino,
Nested exception is:
org.odmg.TransactionNotInProgressException: No
 external transaction found
 at
 org.apache.ojb.odmg.JTATxManager.registerTx(Unknown
 Source)
Seems OJB can't lookup a JTA transaction from the appServer. I think 
this could be a bug in odmg implementation. In method

ImplementationJTAImpl#registerOpenDatabase
OJB always lookup a running JTA-transaction this can't be successful 
when db.open(...) is called on ejbCreate(). Please try to comment out 
the line for transaction lookup and run your test again.

protected synchronized void registerOpenDatabase(DatabaseImpl newDB)
{
   super.registerOpenDatabase(newDB);
   // we shouldn't search for tx when open the database
   // beginInternTransaction();
}
regards,
Armin
Dino Di Cola wrote:
Dear all,
I encountered some problems with Transaction
Management porting my J2EE application from Ora9ias
9.0.2 to Ora9ias 9.0.3 platform.
I tried to reproduce the problem with a simple J2EE
application made up of a test stateless session bean
with a single business method.
This very simple J2EE application is deployed
successfully both in Ora9ias 9.0.2 and Ora9ias 9.0.3.
The business method (test_odmg()) can be successfully
invoked by a RMI client on the Ora9ias 9.0.2
deployment.
On the Ora9ias 9.0.3 deployment however I get the
following error:
The following exception has been catched: Error in
ejbCreate(): No external transaction found; nested
exception is:
org.odmg.TransactionNotInProgressException: No
external transaction found
com.evermind.server.rmi.OrionRemoteException: Error
in ejbCreate(): No external transaction found
at
com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:267)
at
OJBTest_ODMG_StatelessSessionBeanWrapper52.test_odmg(OJBTest_ODMG_StatelessSessionBeanWrapper52.java:83)
at java.lang.reflect.Method.invoke(Native
Method)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:479)
at connection to c99-012.prirm.pride.it/10.2.21.8 as
admin
at
com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1558)
at
com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1511)
at
com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:55)
at
com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
at
com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:50)
at __Proxy4.test_odmg(Unknown Source)
at
it.enidata.psv.ejb.client.TestOJB_ODMG.main(TestOJB_ODMG.java:45)
Nested exception is:
org.odmg.TransactionNotInProgressException: No
external transaction found
at
org.apache.ojb.odmg.JTATxManager.registerTx(Unknown
Source)
at
org.apache.ojb.odmg.TransactionImpl.begin(Unknown
Source)
at
org.apache.ojb.odmg.ImplementationJTAImpl.beginInternTransaction(Unknown
Source)
at
org.apache.ojb.odmg.ImplementationJTAImpl.registerOpenDatabase(Unknown
Source)
at
org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
at
it.enidata.psv.ejb.account.OJBTest_ODMGBean.init(OJBTest_ODMGBean.java:99)
at
it.enidata.psv.ejb.account.OJBTest_ODMGBean.ejbCreate(OJBTest_ODMGBean.java:41)
at
OJBTest_ODMGHome_StatelessSessionHomeWrapper53.callCreate(OJBTest_ODMGHome_StatelessSessionHomeWrapper53.java:145)
at
com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:254)
at
OJBTest_ODMG_StatelessSessionBeanWrapper52.test_odmg(OJBTest_ODMG_StatelessSessionBeanWrapper52.java:83)
at java.lang.reflect.Method.invoke(Native
Method)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at
com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:479)
at connection to c99-012.prirm.pride.it/10.2.21.8
at
com.evermind.server.rmi.OrionRemoteException.receive(OrionRemoteException.java:130)
at
com.evermind.server.rmi.RMIConnection.handleMethodInvocationResponse(RMIConnection.java:1673)
at
com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:532)
at
com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:275)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
at java.lang.Thread.run(Thread.java:484)
The error arises in the ejbCreate() as soon as the
db.open() is invoked. 
- If 

Re: Doclet OJB 1.0

2004-08-06 Thread Edson Carlos Ericksson Richter
You are absolutely right! I had an old db-ojb-1.0rc6 jar lost my
jurassic classpath...

Thanks,

Richter



Em Qui, 2004-08-05 às 17:02, Thomas Dudziak escreveu:
 Edson Carlos Ericksson Richter wrote:
 
  I`m upgrading today from rc6 to 1.0, but I can't get OJB Doclet running. 
  Always I get
  
  Can't create a ojbrepository element under ojbdoclet. Make sure the jar 
  file containing the corresponding subtask class is on the classpath 
  specified in the taskdef that defined {2}.
  
  The taskdef is:
  
 taskdef name=ojbdoclet
 classname=xdoclet.modules.ojb.OjbDocletTask
   classpathref=project.class.path/
  
  And all jars for xdolet are in my project.class.classpath (I'm using 
  NetBeans with Ant 1.6 if this helps).
  
  The compile task is:
  
   target name=repository-xyz
 ojbdoclet destdir=./ojb
 fileset description=Java sources
dir=${src}
includes=**/*.java/
 ojbrepository destinationFile=repository_xyz.xmlAuto/
 /ojbdoclet
   /target
  Any tips?
 
 My guess is that some library is missing. You can run Ant with the -v or 
 -debug argument to get more info.
 If that doesn't get you anywhere, have a look at the ojb-blank archive 
 which you can download from the OJB website. Its build file uses the 
 XDoclet module.
 
 Tom
 
 -
 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]



Re: Problems with TM in ejbCreate()

2004-08-06 Thread =?iso-8859-1?q?Dino=20Di=20Cola?=
Dear Armin,
first of all thanks for your prompt reply!

I applied the change to the
ImplementationJTAImpl#registerOpenDatabase and
executed the test from scratch. 
My simple test application works fine now.
I deployed also the main J2EE application and works
also there at first sight.

I would like to have more insight from you regarding
the patch you proposed to apply in
ImplementationJTAImpl class.

1. You wrote the following: OJB always lookup a
running JTA-transaction this can't be successful when
db.open(...) is called on ejbCreate().
   Could you please give me more info? I cannot see
the problem with ejbCreate(). Thanks!

2. You wrote me it could be a bug in odmg
implementation. And clearly you seems right. 
   I cannot understand however why it was successfully
running on previous versions of ora9ias!?!

3. I commented out the beginInternTransaction()
invocation. Clearly this method is equally invoked
following another code flow. 
   Does it mean it was called twice before your patch?

4. My Session Bean is substantially very close to
src\ejb\org\apache\ojb\ejb\odmg\ODMGSessionBean.java
(taken from the db-ojb-1.0.rc7 distribution).
   The only difference I note is on the Required
attribute marked in the ODMGSessionBean.java javadoc.
I use NotSupported instead. 
   Have I to change the attribute to Required?

5. I am quite sure about this bug (anyway I will check
it more and more and I will keep you informed). 
   If you are certain of this bug too, in what release
do you think to fix it? 
   Have you planned a target release date for next OJB
release?
   What can I do in the meantime a new release will be
officially distributed? 

Armin, I really appreciated your help.
Hope you will answer to all my questions without
getting bored :)

Thanks, 

d.
--








Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo! 
http://companion.yahoo.it

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



Re: Problems with TM in ejbCreate()

2004-08-06 Thread Armin Waibel
Hi Dino,
Dino Di Cola wrote:
Dear Armin,
first of all thanks for your prompt reply!
I applied the change to the
ImplementationJTAImpl#registerOpenDatabase and
executed the test from scratch. 
My simple test application works fine now.
I deployed also the main J2EE application and works
also there at first sight.

I would like to have more insight from you regarding
the patch you proposed to apply in
ImplementationJTAImpl class.
1. You wrote the following: OJB always lookup a
running JTA-transaction this can't be successful when
db.open(...) is called on ejbCreate().
   Could you please give me more info? I cannot see
the problem with ejbCreate(). Thanks!
ejbCreate() was called on session bean initialization, this could be 
done e.g. at startup of your appServer to setup a pool of session bean 
instances. Thus there is no guarantee that the session bean was created 
in context of a running tx.


2. You wrote me it could be a bug in odmg
implementation. And clearly you seems right. 
I will fix this in CVS ASAP.

   I cannot understand however why it was successfully
running on previous versions of ora9ias!?!
e.g. in your previous version your appServer doesn't setup a session 
bean pool at startup, so the instances were created when needed and thus 
when a tx was reachable -- no exception


3. I commented out the beginInternTransaction()
invocation. Clearly this method is equally invoked
following another code flow. 
   Does it mean it was called twice before your patch?

this could be the case, but it doesn't matter, because 
beginInternTransaction() take care of this.


4. My Session Bean is substantially very close to
src\ejb\org\apache\ojb\ejb\odmg\ODMGSessionBean.java
(taken from the db-ojb-1.0.rc7 distribution).
   The only difference I note is on the Required
attribute marked in the ODMGSessionBean.java javadoc.
I use NotSupported instead. 
   Have I to change the attribute to Required?

nearly all operations of the odmg-api have to be in context of an 
transaction and in managed environments it's not allowed to do OJB/ODMG 
related transaction demarcation, thus you always have to use JTA 
transactions and the easiest way is to use container-managed tx.
Alternative you can use bm-tx via UserTransaction.
I wonder how you could use odmg-api in managed environment with 
transaction attribute NotSupported?


5. I am quite sure about this bug (anyway I will check
it more and more and I will keep you informed). 
   If you are certain of this bug too, in what release
do you think to fix it? 
Think the next upcoming OJB 1.0.1 will contain this fix.

   Have you planned a target release date for next OJB
release?
We planed a maintenance release 1.0.1 for last week ;-)
I'm sure we will release the new version in near future.

   What can I do in the meantime a new release will be
officially distributed? 

use the patched class

Armin, I really appreciated your help.
Hope you will answer to all my questions without
getting bored :)
In return for services, never run down OJB ;-)
regards,
Armin

Thanks, 

d.
--


	
		

Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo! 
http://companion.yahoo.it

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