Work on Shapefile locking
-------------------------

                 Key: GEOT-1681
                 URL: http://jira.codehaus.org/browse/GEOT-1681
             Project: GeoTools
          Issue Type: Improvement
          Components: data shapefile
    Affects Versions: 2.5-M0
            Reporter: Jesse Eichar
            Assignee: Jesse Eichar
             Fix For: 2.5-M1


garnett: 5) shapefile
[12:50pm] Jesse_Eichar: Hi all
[12:51pm] Jesse_Eichar: so I've done the first revision of the shapefile work.
[12:51pm] jgarnett: we noticed! or hudson did
[12:51pm] acuster: what was the work?
[12:51pm] Jesse_Eichar: Seems to still work with uDig and geoserver trunk.  
Although geoserver has not been extensively tested but it works better that 2.5 
at least with uDig as a client
[12:51pm] Jesse_Eichar: 2 main things:
[12:51pm] acuster: I know you told me last week but...
[12:52pm] Jesse_Eichar: 1.  Kill most of the duplicated code
[12:52pm] aaime: (wow, did not know at RR you already had GS 2.5... can I have 
a look?)
[12:52pm] Jesse_Eichar: hahs
[12:52pm] Jesse_Eichar: 1.5 maybe
[12:52pm] aaime: lol
[12:52pm] jgarnett: nope 1.6 is what they are beta testing... is it 1.7 ?
[12:52pm] jgarnett: I know *trunk*
[12:53pm] Jesse_Eichar: 1.4 worked for uDig editing 1.5 didn't that I know
[12:53pm] Jesse_Eichar: geoserver trunk with my changes works again. 
[12:53pm] aaime: good
[12:53pm] aaime: too bad they are quite extensive
[12:53pm] aaime: (would not mind a backport to 2.4 otherwise)
[12:53pm] Jesse_Eichar: 2.  I made a class for containing and providing access 
to the files. 
[12:53pm] aaime: and everythign is double checked on the "bastard platform from 
hell" right?
[12:54pm] acuster: ah
[12:54pm] Jesse_Eichar: it has a lock and all readers and writers to the files 
should go through that class.
[12:54pm] Jesse_Eichar: Jody gave me a quick code review and didn't hate it (or 
hated it less than what was there before 
[12:55pm] Jesse_Eichar: Next on my agenda is to add the new feature events to it
[12:55pm] aaime: I did not review
[12:55pm] aaime: but quick question
[12:55pm] Jesse_Eichar: ok
[12:55pm] aaime: are all files locked as a single lot?
[12:55pm] jgarnett: he is modest; the code is fine. I need a few more utility 
functions (since there is a complicated process to check if we are using a File 
or URL). And I want to make sure the set is open ended (for things like sld and 
properites files)
[12:55pm] Jesse_Eichar: yes
[12:55pm] aaime: nice
[12:55pm] Jesse_Eichar: The lock is a reentrant lock
[12:55pm] Jesse_Eichar: so if you lock one you can hack away and no other 
thread can interrupt.
[12:56pm] Jesse_Eichar: BUT (as I said in my email)
[12:56pm] aaime: right, but what I meant is a little different
[12:56pm] desruisseaux: On getInfo proposal, I have comment: getEnvelope() 
should returns the GeoAPI interface, not the JTS class
[12:56pm] aaime: if thread a takes shp, thread b takes dbf, and no one gives 
up, we have a deadlock
[12:56pm] desruisseaux: getKeywords() should returns a Collection<String> (List 
or Set at implementor choice), not a String[] array.
[12:56pm] aaime: desriusseaux++
[12:56pm] jgarnett: interesting point martin; right now it returns the GeoTools 
class ReferencedEnvelope (which is both a JTS Envelope and a GeoAPI BoundingBox)
[12:56pm] Jesse_Eichar: That is done too.  There is only one lock
[12:56pm] Jesse_Eichar: its not a lock for each
[12:57pm] desruisseaux: getTitle() as internationalString, but also 
getDescription()
[12:57pm] Jesse_Eichar: windows can still deadlock
[12:57pm] Jesse_Eichar: get a writer
[12:57pm] Jesse_Eichar: then get a reader
[12:57pm] Jesse_Eichar: then try to read
[12:57pm] desruisseaux: Yes Jody, but the method signature in the interface is 
to returns a JTS envelope.
[12:57pm] Jesse_Eichar: the writer locks the file and the reader cries.
[12:57pm] jgarnett: (lets wait until after the meeting!)
[12:57pm] aaime: Jesse, you should not be able to get a reader while someone is 
writing?
[12:57pm] Jesse_Eichar: its windows man
[12:57pm] Jesse_Eichar: not me
[12:58pm] Jesse_Eichar: What you are supposed to do is:
[12:58pm] Jesse_Eichar: get a File
[12:58pm] Jesse_Eichar: (I think)
[12:58pm] Jesse_Eichar: and use the same file *OBJECT* to get a reader and 
writer
[12:58pm] Jesse_Eichar: I think right now the implementation creates new File 
objects
[12:59pm] Jesse_Eichar: We might be able to fix that if we re-use the same 
files.  This is just the way it was writeen previously
[12:59pm] Jesse_Eichar: and I didn't think of this solution til now
[12:59pm] Jesse_Eichar: But this isn't a problem normally
[12:59pm] aaime: Well, an improvement is an improvement
[12:59pm] Jesse_Eichar: because the ShapefileWriter and DBFWriter and... so 
on.. create a temporary file and write to that
[1:00pm] aaime: but it would be nice if you dumped the above on an improvement 
jira issue
[1:00pm] Jesse_Eichar: then on close the switch happens
[1:00pm] Jesse_Eichar: ah ok will do

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to