ArcSDE SDK Java quick practice 6

Source: Internet
Author: User
I. layer lock
· Layer lock types and functions

Two locks are defined in the ArcSDE layer: se_read_lock and se_write_lock. The scope of lock impact can be the entire layer or a certain range in the layer.

When the data is locked in the form of se_read_lock, the data is protected to prevent updates. Other users can also create the se_read_lock lock on the same data, but they cannot add the se_write_lock or update the data.

When the data is locked in the form of se_write_lock, this part of data cannot be updated by other users, and other users cannot add any lock to the same data.

It can also be introduced that data locked in the se_read_lock mode on the layer can overlap with each other, while data locked in the se_write_lock mode cannot overlap with each other.

· Use locks

The following code shows how to add and release locks on layers:

Seconnection conn = getconn ();

If (Conn! = NULL ){

Try {

Selayer layer = new selayer (Conn, "sde_cities", "shape ");

Layer. Lock (selayer. se_read_lock); // lock the entire layer in se_read_lock mode.

Layer. freelock ();

Layer. Lock (selayer. se_write_lock); // lock the entire layer in se_write_lock mode.

Layer. freelock ();

Layer. lockarea (selayer. se_read_lock, new seextent (-116, 39,

117, 40); // lock part of data in the se_read_lock Mode

Layer. freelock ();

} Catch (seexception e ){

E. printstacktrace ();

} Finally {

Try {

Conn. Close ();

} Catch (seexception e ){

E. printstacktrace ();

}

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.