on 2013 Sep 24 10:13 AM
Here's my setup:
The problem after years of this setup is that yesterday out of the blue I had a GUID clash on one of my tables on the "uniqueidentifier" column at the consolidated DB after an attempted Update-Insert from the remote. Then this morning I had another GUID clash. So now i'm starting to freak out.
My users have started to upgrade to iOS 7. Is there an issue in the way "NEWID()" is called under iOS 7? Or for what other reason could I get identical "GUID's" on 2 separate devices 1 day apart? Any help is appreciated. Thanks!
I assume these colliding GUIDs are all recently generated on iOS 7. It indeed appears that iOS 7 has broken UltraLite's code to determine the device identifier portion. This will be fixed. In the meantime we need a workaround.
Note: this defect should only affect version 12 on iOS 7. Version 16 uses an updated method for GUID generation.
I think the best immediate workaround is to explicitly insert GUIDs (as you've already wisely concluded 😉 in place of NEWID() and NEWID defaults.
In addition to NSUUID, you could use CoreFoundation as follows:
UL_DECL_BINARY( 16 ) bin; CFUUIDRef uuid = CFUUIDCreate( kCFAllocatorDefault ); CFUUIDBytes rawbytes = CFUUIDGetUUIDBytes( uuid ); memcpy( bin.data, &rawbytes, 16 ); bin.len = 16; CFRelease( uuid ); prepstmt->SetParameterBinary( col, (ul_binary *)&bin );
Note that the binary representation can be inserted directly if you use the ul_binary type. This is slightly more efficient if that's a concern. uuid_generate() is also available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Tim,
I did just confirm that the ID's are coming from iOS 7. I'm in the process of manually iterating any inserts that use "NEWID()" with the iOS GUID generator for iOS 6+:
NSString *uuid = [[NSUUID UUID] UUIDString];
Please keep us posted on a workaround for the DB generated UUID or when and EBF can be released. Thanks!
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.