[RomaFramework-dev] R: transaction example
Brought to you by:
lvca
|
From: Luca G. <luc...@as...> - 2007-06-25 15:20:41
|
Hi,
Sorry for delay on reponse. You can use the power of JDO 2 standard in =
Roma.
You can handle more objects in your method and commit anything in a
transactional fashion.
Example:
PersistenceAspect tx =3D ObjectContext.getInstance().getComponent(
"TxPersistenceAspect" );
Try{
tx.createObject( new Employee() );
tx.createObject( new Invoice() );
tx.commit();
} finally{
tx.close();
}
TxPersistenceAspect is the component declared in Spring's
applicationContext.xml file.
Hope to be help
bye,
Luca Garulli
Blogging on: http://zion-city.blogspot.com
http://www.AssetData.it
http://www.RomaFramework.org - The new way to build applications
http://www.OrienTechnologies.com - Light ODBMS, All in one JDO solution
-----Messaggio originale-----
Da: rom...@li...
[mailto:rom...@li...] Per =
conto
di Jack Wang
Inviato: luned=A8=AC 14 maggio 2007 11.01
A: rom...@li...
Oggetto: [RomaFramework-dev] transaction example
Hi, Roma developers,
I am a Roma newbie. Please ask where can I get the Roma database =
transaction
example to process two tables ? In hibernate or jdbc, I can set the =
entity's
attribute before post the transaction.Maybe my question is how can I =
code a
main(String[] args) method to call Roma's API, in order to save two =
records
into two tables in one transaction. Thanks.
wj
___________________________________________________________
=D1=C5=BB=A2=C3=E2=B7=D1=D3=CA=CF=E43.5G=C8=DD=C1=BF=A3=AC20M=B8=BD=BC=FE=
=A3=A1
http://cn.mail.yahoo.com/
|