RE: [Linux-programlama] java&transaction

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Melih Sakarya (Melih.Sakarya@pepsi.com.tr)
Date: Fri 10 Mar 2006 - 10:52:59 EET


conn.setAutoCommit(false);

 

//sql islemleri

conn.commit();

 

hata ise

conn.rollback();

 

yanliz outo commit olmama durumunda rollback yada commit olmaz ise

tablo lock durumuna düsebilir

 

Saygilar

 

 

 

-----Original Message-----
From: linux-programlama-bounces@liste.linux.org.tr [mailto:linux-programlama-bounces@liste.linux.org.tr] On Behalf Of Ali Dereli
Sent: Friday, March 10, 2006 10:48 AM
To: linux-programlama@liste.linux.org.tr
Subject: [Linux-programlama] java&transaction

 

Merhaba;

Gecenlerde listede transaction konusu tartısıldı. İlgimi cekmişti ancak şimdi bakabildim.
Ben postgresql kullanıyorum ve olay söyleymiş.
Begin;
sql;
sq;
Commit;

Peki bunu javada prepareStatement kullanarak nasıl yazarız.
Mesela
sql_1="select * from tablo_1 where id=?";
sql_2="delete from tablo_2 where id=?";

bu ifadeler program basında derlenip saklanıyor. Kullanmak istedigimde
sql_1.setInt(1, x);
sql_1.executeQuery();
sql_2.setInt(1, x);
sql_2.executeUpdate();
gibi bi kullanımı var. Ama transaction olayını işin işine nasıl katıcaz?
Mantıgını dahi kurabilmiş degilim.

Saygılar.

--------------
Bu e-posta ve icerigi kisiye ozel ve gizli bilgiler icerebilir.
Eger mesajin muhatabi veya muhataba iletmekle yukumlu yetkili
temsilcisi siz degilseniz, bu mesaji cogaltmak, dagitmak, aciklamak
dahil olmak uzere herhangi bir suretle kullanmamaniz gerektigini,
aksine davranisinizin hukuka aykirilik teskil edebilecegini
bildiririz.Eger bu mesaji yanlislikla aldiysaniz, lutfen gondericiye
e-posta ile bildirerek siliniz
--------------
This email and its contents may contain information that is
privileged and confidential.If you are not an intended recipient,or
the agent responsible for delivering this email to the intended
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited
and may be unlawful. If you received this email in error, please
notify the sender by replying to this email and delete the email sent in error.

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.