From: Don S. <do...@se...> - 2002-10-21 19:33:47
|
Although for what it's worth, my vote is still just to use the PEAR sequencer. It is a "standard" of sorts. Do modules go through the core sqlInsert function for their database transactions? Don. On Mon, 21 Oct 2002, Don Seiler wrote: > I like this better than just selecting the max ID from the table and > incrementing. > > I'm assuming you lock the sequencer table while incrementing? If so is > there any chance of creating dead-locks on multiple inserts? > > Don. > > On Mon, 21 Oct 2002, Matthew McNaney wrote: > > > > > > I would like to tak a closer look at the implemetation of this. It > > > looks like it's creating an extra table just to calculate the next > > > sequence number. Do you really want this since it could effectively > > > double the amount of tables in the database? > > > > Hmmm. There might be a way around this. > > > > Say we create our OWN sequencer. > > > > table : core_sequencer > > ----------------- > > column : table_name > > column : primary_key_name > > column : current_id > > > > When sqlImport calls "create table" with a primary key then the table name > > and key are inserted into the sequencer. > > > > Then when sqlInsert is called the table name is selected. The column name > > and current id are returned and the id is incremented. > > > > This could effectively make sqlInsert a little easier. > > > > $core->sqlInsert($data_array, "table_name", TRUE); > > > > The TRUE telling sqlInsert to increment. It would already know WHAT to > > increment from the sequencer table. So you could even have: > > > > $core->sqlInsert($data_array, "table_name"); > > > > With an automatic check to the sequencer table, effectively returning us > > to the original format... that we had... 90 commits ago... ;-) > > > > Let me know what you guys think... > > > > Matthew McNaney > > Internet Systems Architect > > Electronic Student Services > > Email: ma...@tu... > > URL: http://phpwebsite.appstate.edu > > Phone: 828-262-6493 > > > > > > > > > > ------------------------------------------------------- > > This sf.net emial is sponsored by: Influence the future of > > Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) > > program now. http://ad.doubleclick.net/clk;4699841;7576298;k? > > http://www.sun.com/javavote > > _______________________________________________ > > Phpwebsite-developers mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > > > > > > ------------------------------------------------------- > This sf.net emial is sponsored by: Influence the future of > Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) > program now. http://ad.doubleclick.net/clk;4699841;7576298;k? > http://www.sun.com/javavote > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > |