Re: NSPersistentDocument, Export (Save As) and wal/shm

2014-11-17 Thread Sean McBride
On Sat, 15 Nov 2014 14:02:44 -0500, Jerry Krinock said:


 On 2014 Nov 15, at 13:38, Fritz Anderson fri...@manoverboard.org wrote:

 rdar://18994451; I classified it as a data-loss bug, given the near-
certainty of the loss of the journal files.

Indeed it is, Fritz, for the reasons you stated.

Here was my version, Bug 15873041:

http://openradar.appspot.com/radar?id=5268845828767744

Oddly, I think, it has not even been closed as a duplicate.  Its status
is still Open, with no comments from Apple.  It has attached a sample
project, even though it only takes a few minutes to reproduce from an
Apple sample project.

My version is rdar://19001234, which I just created.  My DTS incident came 
back We believe this issue is a bug. Please file a bug report [...] we have 
assigned a replacement incident back to your account.  Seems they did not 
understand I was looking for a workaround, which I have now reiterated.  
Hopefully something will come of it...

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSPersistentDocument, Export (Save As) and wal/shm

2014-11-17 Thread Richard Charles
On Nov 17, 2014, at 9:52 AM, Sean McBride s...@rogue-research.com wrote:

 Seems they did not understand I was looking for a workaround, which I have 
 now reiterated.

Let us know if you find a workaround.

Richard Charles


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSPersistentDocument, Export (Save As) and wal/shm

2014-11-15 Thread Fritz Anderson
On Nov 14, 2014, at 8:02 PM, Richard Charles rcharles...@gmail.com wrote:

 I just checked my OS X application (Xcode 6.1, Objective-C source, 10.10 SDK, 
 running on 10.9.5). When doing a save as the new document also appears on 
 disk with external journaling files (shm and wal). That is nasty, very 
 distasteful from a users point of view!

rdar://18994451; I classified it as a data-loss bug, given the near-certainty 
of the loss of the journal files.

— F


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSPersistentDocument, Export (Save As) and wal/shm

2014-11-15 Thread Jerry Krinock

 On 2014 Nov 15, at 13:38, Fritz Anderson fri...@manoverboard.org wrote:

 rdar://18994451; I classified it as a data-loss bug, given the near-certainty 
 of the loss of the journal files.

Indeed it is, Fritz, for the reasons you stated.

Here was my version, Bug 15873041:

http://openradar.appspot.com/radar?id=5268845828767744

Oddly, I think, it has not even been closed as a duplicate.  Its status is 
still Open, with no comments from Apple.  It has attached a sample project, 
even though it only takes a few minutes to reproduce from an Apple sample 
project.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

NSPersistentDocument, Export (Save As) and wal/shm

2014-11-14 Thread Fritz Anderson
OS X application, Yosemite (host and target), Xcode 6.1, all-Swift. If you 
duplicate (save-as) an existing document, the new document appears on disk with 
external journaling files (SHM, WAL).

It is impossible to state how undesirable this is without descending into 
sarcasm.

The solutions I’ve seen from a web search are a year or more old, and have 
proven ineffective.

What is the current thinking on this? This is another of those things that are 
so conspicuous that I must be missing something obvious.

Details below the fold.

— F


This concern seems to have been perking along since the introduction of 
Mavericks.

One commenter said DTS volunteered these solutions:

1. Continue to use the Mountain Lion SDK for Mavericks development.

2. Swizzle something. I stopped reading.

Time’s run out on those.

A year ago, it was suggested on this list that the persistent-document subclass 
should override the method for which the Swift signature is:

configurePersistentStoreCoordinatorForURL(_: NSURL!,
ofType: String!,
modelConfiguration: String?,
storeOptions: [NSObject : AnyObject]!,
error: NSErrorPointer) - Bool

… and pass @{ NSSQLitePragmasOption : @{ @journal_mode : @DELETE } } as 
storeOptions: to super. With that pragma set, SQLite is supposed to suppress 
the journal files.

An account of the strong-typing nightmare would veer once again into sarcasm. 
I’m unhappy about assuming storeOptions will always be nil.

Here is my attempt:

```
let newOpts = [NSSQLitePragmasOption : [journal_mode : DELETE]]

// Also suggested:
// let newOpts = [JOURNAL:DELETE]
// This doesn’t work, either.

return super.configurePersistentStoreCoordinatorForURL(url, 
   ofType: fileType,modelConfiguration: configuration,
   storeOptions: newOpts, error: error)
```

The breakpoint at the return line fires. newOpts has the expected content. I 
still get WAL and SHM files. Using … [journal_mode : OFF]] does no better.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSPersistentDocument, Export (Save As) and wal/shm

2014-11-14 Thread Sean McBride
On Fri, 14 Nov 2014 17:45:13 -0600, Fritz Anderson said:

OS X application, Yosemite (host and target), Xcode 6.1, all-Swift. If
you duplicate (save-as) an existing document, the new document appears
on disk with external journaling files (SHM, WAL).

I just noticed this the other day (in 10.9.5) after switching my app from 10.8 
SDK to 10.9 SDK (for the v2 gatekeeper changes).

Pathetic that it's not fixed in 10.10!

It is impossible to state how undesirable this is without descending
into sarcasm.

I guess it says a lot about the state of NSPersistentDocument. :(

Check out Mike Abdullah's BSManagedDocument if you can.

The solutions I’ve seen from a web search are a year or more old, and
have proven ineffective.

What is the current thinking on this? This is another of those things
that are so conspicuous that I must be missing something obvious.

Jerry Krinock's solutions, that you no doubt found googling, seem to be working 
for me, but I don't like swizzling if I can avoid it.

I actually just opened a DTS incident on this the other day, no word back yet.  
Will follow up here.

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSPersistentDocument, Export (Save As) and wal/shm

2014-11-14 Thread Richard Charles
On Nov 14, 2014, at 4:45 PM, Fritz Anderson fri...@manoverboard.org wrote:

 OS X application, Yosemite (host and target), Xcode 6.1, all-Swift. If you 
 duplicate (save-as) an existing document, the new document appears on disk 
 with external journaling files (SHM, WAL).

On Nov 14, 2014, at 5:26 PM, Sean McBride s...@rogue-research.com wrote:

 I just noticed this the other day (in 10.9.5) after switching my app from 
 10.8 SDK to 10.9 SDK (for the v2 gatekeeper changes).


I just checked my OS X application (Xcode 6.1, Objective-C source, 10.10 SDK, 
running on 10.9.5). When doing a save as the new document also appears on disk 
with external journaling files (shm and wal). That is nasty, very distasteful 
from a users point of view!

On Nov 14, 2014, at 5:26 PM, Sean McBride s...@rogue-research.com wrote:

 Check out Mike Abdullah's BSManagedDocument if you can.

I just did the other day but it does not work for me. I need the ability to use 
the xml file format as well as sqlite.

Richard Charles


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com