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 Mahler Thomas <th...@itellium.com> on 2004/09/20 12:04:35 UTC
FW: JTA Transaction with OJb
Hi,
I am trying to use the JTA Transaction with OJb. Can you please give
me some articles / code links where i can get a reference implementation. I
want to use it with weblogic server.
Thanks and regards,
Sudhakar
Cognizant Technology Solutions India Pvt Ltd.
Tidel Park - 6th Floor, Chennai 600 113
Ph: 91-44-22540555 x 7113 Vnet 47421
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged
information.
If you are not the intended recipient, please contact the sender by reply
e-mail and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding,
printing or copying of this email or any action taken in reliance on this
e-mail is strictly
prohibited and may be unlawful.
Visit us at http://www.cognizant.com
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Howto get sequence value before
Posted by Armin Waibel <ar...@apache.org>.
Hi,
Lázaro Miguel Fung wrote:
> Hi,
>
> How I can get a sequence value using SequenceManagerNextValImpl before OJB
> insert a new object in the DB.
>
You can generate an Identity object before insert, then the PK fields
will be set in object and you can get them from the generated Identity, see
http://db.apache.org/ojb/docu/guides/sequencemanager.html#Force+computation+of+unique+values
Another possibility is to lookup a new sequence value using
SequenceManager#getUniqueValue(FieldDescriptor field) via
broker.serviceSequenceManager()
and then *set* the PK values by your own in the new object (The PK
fields can be obtained from the ClassDescriptor and this from
broker.getClassDescriptorFor(object)).
In both cases I recommend to use broker.store(Object obj,
ObjectModification mod) for best performance.
Or use one of OJB callback interfaces to extract the PK value before
insert (PersistenceBrokerAware, PBLifeCycleListener more info see javadoc).
All suggestions are not possible when database IDENTITY columns will be
used (but you don't ;-)), see
http://db.apache.org/ojb/docu/guides/sequencemanager.html#Identity+based+sequence+manager
regards,
Armin
> TIA.
>
> LFung
>
>
>
> ---------------------------------------------------------------------
> 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
Howto get sequence value before
Posted by Lázaro Miguel Fung <lf...@desliang.com>.
Hi,
How I can get a sequence value using SequenceManagerNextValImpl before OJB
insert a new object in the DB.
TIA.
LFung
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org