You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Corey <co...@spectrumsoftware.net> on 2004/05/24 19:05:15 UTC

PB vs. ODMG

    Hi all,

    Sorry, newbie posting here. I've read all the docs and played with all of
    the tutorials, but now I need some advice. The question is whether to code
    directly to the PB or to code to ODMG or JDO. I'm attracted to the simplicity
    of the PB but am concerned about the management of 1:n or m:n relationships
    between objects. The documentation indicates that when using the PB, the relationships
    between collections of objects would need to resolved manually using the link()
    and unlink() calls. The document also seems to indicate that this would not be
    the case if ODMG were employed. Can anyone iterate over the good, bad and
    ugly of one method verses the other? Looking for the voice of experience here.

    Thanks
    --Corey
______________________________________________________
William C. Brown
Chief Architect. Spectrum Software Inc.

11445 Johns Creek Pkwy
Duluth, GA. 30097.
Suite 300.
Tel > 770.813.4952
e   > corey@spectrumsoftware.net
web > www.spectrumscm.com
yahoo > caldron68

----- Original Message ----- 
From: "Rajani" <ra...@sysarris.soft.net>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, May 24, 2004 7:30 AM
Subject: Problem reading a clob object


> Hi All,
> 
>      I'm using oracle 8i database.
>      The table has a column with the data-type as CLOB which we are using to
> store xml data.
>      It is mapped to String data type in the java object.
>      I have no problem inserting  xml data with this mapping. But when i try
> to fetch the record using persistence broker, Its failing to retrieve the
> data.
>      Can anybody throw some light on this problem?
> 
> Thanks
> Rajani
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: PB vs. ODMG

Posted by Thomas Mahler <th...@web.de>.
http://db.apache.org/ojb/faq.html#What%20are%20the%20differences%20between%20the%20PersistenceBroker%20API%20and%20the%20ODMG%20API?%20Which%20one%20should%20I%20use%20in%20my%20applications?

Corey wrote:
>     Hi all,
> 
>     Sorry, newbie posting here. I've read all the docs and played with all of
>     the tutorials, but now I need some advice. The question is whether to code
>     directly to the PB or to code to ODMG or JDO. I'm attracted to the simplicity
>     of the PB but am concerned about the management of 1:n or m:n relationships
>     between objects. The documentation indicates that when using the PB, the relationships
>     between collections of objects would need to resolved manually using the link()
>     and unlink() calls. The document also seems to indicate that this would not be
>     the case if ODMG were employed. Can anyone iterate over the good, bad and
>     ugly of one method verses the other? Looking for the voice of experience here.
> 
>     Thanks
>     --Corey
> ______________________________________________________
> William C. Brown
> Chief Architect. Spectrum Software Inc.
> 
> 11445 Johns Creek Pkwy
> Duluth, GA. 30097.
> Suite 300.
> Tel > 770.813.4952
> e   > corey@spectrumsoftware.net
> web > www.spectrumscm.com
> yahoo > caldron68
> 
> ----- Original Message ----- 
> From: "Rajani" <ra...@sysarris.soft.net>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Monday, May 24, 2004 7:30 AM
> Subject: Problem reading a clob object
> 
> 
> 
>>Hi All,
>>
>>     I'm using oracle 8i database.
>>     The table has a column with the data-type as CLOB which we are using to
>>store xml data.
>>     It is mapped to String data type in the java object.
>>     I have no problem inserting  xml data with this mapping. But when i try
>>to fetch the record using persistence broker, Its failing to retrieve the
>>data.
>>     Can anybody throw some light on this problem?
>>
>>Thanks
>>Rajani
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: PB vs. ODMG

Posted by Corey <co...@spectrumsoftware.net>.
    Thanks Armin. 

    We're setting up our test databases right now. I'll let you know
    how we make out.

    Cheers,
    --Corey
______________________________________________________
William C. Brown
Chief Architect. Spectrum Software Inc.

11445 Johns Creek Pkwy
Duluth, GA. 30097.
Suite 300.
Tel > 770.813.4952
e   > corey@spectrumsoftware.net
web > www.spectrumscm.com
yahoo > caldron68

----- Original Message ----- 
From: "Armin Waibel" <ar...@apache.org>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, May 25, 2004 4:09 AM
Subject: Re: PB vs. ODMG


> Hi Corey,
> 
> Corey wrote:
> >     Hi all,
> > 
> >     Sorry, newbie posting here. I've read all the docs and played with all of
> >     the tutorials, but now I need some advice. The question is whether to code
> >     directly to the PB or to code to ODMG or JDO.
> 
> PB api is stable and no major bugs are known (latest CVS). All top-level
> api use the PB-kernel to work. PB api is very flexible.
> ODMG api implementation nearly stable some known issues (some issues
> with m:n relation handling, restore of of object state - hope to fix
> this in next 2 weeks)
> JDO, current implementation is a plugin to the SUN JDO Reference
> Implementation. Work on a native implementation has started (first
> version is scheduled for 1.1 or 1.2).
> 
> > I'm attracted to the simplicity
> >     of the PB but am concerned about the management of 1:n or m:n relationships
> >     between objects. The documentation indicates that when using the PB, the relationships
> >     between collections of objects would need to resolved manually using the link()
> >     and unlink() calls.
> 
> This is not correct. You can do all relation handling by hand using
> linking (or set all FK by your own) with PB-api, but it is also possible
> to let OJB do all linking stuff automatic. This depends on the used
> auto-xxx setting
> http://db.apache.org/ojb/tutorial3.html#Setting%20Load,%20Update,%20and%20Delete%20Cascading
> With PB-api all is possible ;-)
> 
> regards,
> Armin
> 
> > The document also seems to indicate that this would not be
> >     the case if ODMG were employed. Can anyone iterate over the good, bad and
> >     ugly of one method verses the other? Looking for the voice of experience here.
> > 
> >     Thanks
> >     --Corey
> > ______________________________________________________
> > William C. Brown
> > Chief Architect. Spectrum Software Inc.
> > 
> > 11445 Johns Creek Pkwy
> > Duluth, GA. 30097.
> > Suite 300.
> > Tel > 770.813.4952
> > e   > corey@spectrumsoftware.net
> > web > www.spectrumscm.com
> > yahoo > caldron68
> > 
> > ----- Original Message ----- 
> > From: "Rajani" <ra...@sysarris.soft.net>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Monday, May 24, 2004 7:30 AM
> > Subject: Problem reading a clob object
> > 
> > 
> > 
> >>Hi All,
> >>
> >>     I'm using oracle 8i database.
> >>     The table has a column with the data-type as CLOB which we are using to
> >>store xml data.
> >>     It is mapped to String data type in the java object.
> >>     I have no problem inserting  xml data with this mapping. But when i try
> >>to fetch the record using persistence broker, Its failing to retrieve the
> >>data.
> >>     Can anybody throw some light on this problem?
> >>
> >>Thanks
> >>Rajani
> >>
> > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Exception thrown from abortTransaction (patch needed ?)

Posted by Armin Waibel <ar...@apache.org>.
Hi Guillaume,

your patch makes sense IMO.
Is in CVS now. Thanks for the patch.

regards
Armin

Guillaume Nodet wrote:

> I've got the following error that is thrown when rolling back a transaction.
> 
> org.apache.ojb.broker.PersistenceBrokerException: Set autoCommit(false)
> failed
> 	at
> org.apache.ojb.broker.platforms.PlatformDefaultImpl.changeAutoCommitState(Pl
> atformDefaultImpl.java:208)
> 	at
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.restoreAutoCommitSta
> te(ConnectionManagerImpl.java:244)
> 	at
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Connec
> tionManagerImpl.java:229)
> 	at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.abortTransaction(Persistenc
> eBrokerImpl.java:371)
> 	at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Dele
> gatingPersistenceBroker.java:149)
> 	at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Dele
> gatingPersistenceBroker.java:149)
> 	...
> 
> This exception is ok because the database has been shut down, but it is
> thrown from the finally statement in the
> ConnectionMagagerImpl.localRollback method. In this piece of code, the
> connection is rolled back and SQLException are catched and logged (not
> rethrown). The problem is when the restoreAutoCommitState is called
> and fails, the exception i wrote above is thrown.
> So my question is: why do the localRollback method catches sql exceptions
> launched from rollback and not from the restoreAutoCommitState ?
> 
> Maybe the finally statement of the ConnectionMagagerImpl.localRollback could
> be:
> 
>         finally
>         {
> 		try {
>             	restoreAutoCommitState();
> 		} catch (OJBRuntimeException e) {
> 			// Ignore or log exception
> 		}
>             this.releaseConnection();
>         }
> 
> Cheers,
> Guillaume
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Exception thrown from abortTransaction (patch needed ?)

Posted by Guillaume Nodet <gu...@deliasystems.com>.
I've got the following error that is thrown when rolling back a transaction.

org.apache.ojb.broker.PersistenceBrokerException: Set autoCommit(false)
failed
	at
org.apache.ojb.broker.platforms.PlatformDefaultImpl.changeAutoCommitState(Pl
atformDefaultImpl.java:208)
	at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.restoreAutoCommitSta
te(ConnectionManagerImpl.java:244)
	at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Connec
tionManagerImpl.java:229)
	at
org.apache.ojb.broker.core.PersistenceBrokerImpl.abortTransaction(Persistenc
eBrokerImpl.java:371)
	at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Dele
gatingPersistenceBroker.java:149)
	at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Dele
gatingPersistenceBroker.java:149)
	...

This exception is ok because the database has been shut down, but it is
thrown from the finally statement in the
ConnectionMagagerImpl.localRollback method. In this piece of code, the
connection is rolled back and SQLException are catched and logged (not
rethrown). The problem is when the restoreAutoCommitState is called
and fails, the exception i wrote above is thrown.
So my question is: why do the localRollback method catches sql exceptions
launched from rollback and not from the restoreAutoCommitState ?

Maybe the finally statement of the ConnectionMagagerImpl.localRollback could
be:

        finally
        {
		try {
            	restoreAutoCommitState();
		} catch (OJBRuntimeException e) {
			// Ignore or log exception
		}
            this.releaseConnection();
        }

Cheers,
Guillaume


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: PB vs. ODMG

Posted by Armin Waibel <ar...@apache.org>.
Hi Corey,

Corey wrote:
>     Hi all,
> 
>     Sorry, newbie posting here. I've read all the docs and played with all of
>     the tutorials, but now I need some advice. The question is whether to code
>     directly to the PB or to code to ODMG or JDO.

PB api is stable and no major bugs are known (latest CVS). All top-level
api use the PB-kernel to work. PB api is very flexible.
ODMG api implementation nearly stable some known issues (some issues
with m:n relation handling, restore of of object state - hope to fix
this in next 2 weeks)
JDO, current implementation is a plugin to the SUN JDO Reference
Implementation. Work on a native implementation has started (first
version is scheduled for 1.1 or 1.2).

> I'm attracted to the simplicity
>     of the PB but am concerned about the management of 1:n or m:n relationships
>     between objects. The documentation indicates that when using the PB, the relationships
>     between collections of objects would need to resolved manually using the link()
>     and unlink() calls.

This is not correct. You can do all relation handling by hand using
linking (or set all FK by your own) with PB-api, but it is also possible
to let OJB do all linking stuff automatic. This depends on the used
auto-xxx setting
http://db.apache.org/ojb/tutorial3.html#Setting%20Load,%20Update,%20and%20Delete%20Cascading
With PB-api all is possible ;-)

regards,
Armin

> The document also seems to indicate that this would not be
>     the case if ODMG were employed. Can anyone iterate over the good, bad and
>     ugly of one method verses the other? Looking for the voice of experience here.
> 
>     Thanks
>     --Corey
> ______________________________________________________
> William C. Brown
> Chief Architect. Spectrum Software Inc.
> 
> 11445 Johns Creek Pkwy
> Duluth, GA. 30097.
> Suite 300.
> Tel > 770.813.4952
> e   > corey@spectrumsoftware.net
> web > www.spectrumscm.com
> yahoo > caldron68
> 
> ----- Original Message ----- 
> From: "Rajani" <ra...@sysarris.soft.net>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Monday, May 24, 2004 7:30 AM
> Subject: Problem reading a clob object
> 
> 
> 
>>Hi All,
>>
>>     I'm using oracle 8i database.
>>     The table has a column with the data-type as CLOB which we are using to
>>store xml data.
>>     It is mapped to String data type in the java object.
>>     I have no problem inserting  xml data with this mapping. But when i try
>>to fetch the record using persistence broker, Its failing to retrieve the
>>data.
>>     Can anybody throw some light on this problem?
>>
>>Thanks
>>Rajani
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org