FYI:
We are calling the code
tMap.setPrimaryKeyMethod(TableMap.AUTOINCREMENT);
in the doBuild method in our maps. (this is generated by Troque for us).
And since the default value of the Ids are 0, it works pretty well for
us.
This lead me to the idea of protect the auto "incremented" members from
external access.
We use the mysql feature because our DB is not only filled by our
turbine based applications. Those applications (tests scripts,
pre-filling) are not always aware of the ID_BROKER and would break it if
miss-used.
May be could it be optional for the Torque users?
Didier.
Jon Stevens wrote:
>
> FYI, there is an IRC server on cvs.working-dogs.com:6667 and we do Turbine
> discussion in #turbine. Today, Rafal and I had a quick discussion about
> autoincrement being turned on on Turbine's .sql files...here is the
> conclusion of that discussion for archival purposes. :-)
>
> 2:43:12 PM: <Rafal> hmm, the mapbuilder specifes
> primaryKeyMetod(ID_BROKER) so I think we *should* remove those
> auto_increments
> 2:43:12 PM: <Rafal> otherwise it probably work funny :)
> 2:43:39 PM: <jon> yep...totally
> 2:43:52 PM: <jon> it is funny though...mysql will ignore autoincrement if
> you specify the id
> 2:44:24 PM: <Rafal> will it? I thaught that it would use auto for insert
> anyway
> 2:44:39 PM: <Rafal> you can overwirte it with update only, but I might be
> wrong
> 2:45:34 PM: <jon> not my experience so far...
> 2:46:06 PM: <Rafal> I can run a quick test from the command line
> client...
> 2:48:11 PM: <jon> i just did a test...
> 2:48:13 PM: <jon> it worked
> 2:48:40 PM: <Rafal> me too, and it worked too! :))
> 2:49:01 PM: <Rafal> ok, I removed them already to avoid confusion...
> 2:58:10 PM: <jon> cool
> 3:03:17 PM: <jon> ok, i just read the mysql documentation...
> 3:03:35 PM: <jon>
> http://www.mysql.com/documentation/mysql/commented/manual.php?section=CREATE
> _TABLE
> 3:03:43 PM: <jon> it details the behavior pretty well...
> 3:03:51 PM: <jon> you need to do an insert with null or 0 on that column
> 3:04:05 PM: <jon> having it be autoincrement in the .sql files is needed if
> people don't want to use the idbroker
> 3:04:07 PM: <jon> so put it back
> 3:04:08 PM: <jon> :-)
>
> -jon
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
--
mailto:[EMAIL PROTECTED] http://www.idbsoft.ch
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]