in reply to Re^3: Sequences, last_insert_id, SQLite, and Oracle
in thread Sequences, last_insert_id, SQLite, and Oracle

Preversely, if the database has no transactions then your technique is indeed safe. Likewise if you don't use the sequence inside a transaction -- but if you do have them and want to use them, odds are you'd like to be able to use the sequence with them :-)

I'm using SQLite for development and will possibly move to Oracle for production. SQLite is fine for applications that are not heavily multiuser: locking certainly exists, it's just not very finely-grained. (There are of course other limitations, like how putting the database on NFS is a bad idea, but for my purposes they don't present a problem.)

  • Comment on Re^4: Sequences, last_insert_id, SQLite, and Oracle

Replies are listed 'Best First'.
Re^5: Sequences, last_insert_id, SQLite, and Oracle
by terce (Friar) on Jun 14, 2005 at 14:32 UTC
    Sure. I guess it's just a question of how "platform-agnostic" you need/want to be. Or, to put it another way, you're limited by the lowest common denominator of SQL support amongst your chosen platforms.

    I'm sure you've got good reasons to develop on one platform and then go into production on another (and, of course, I've got no knowledge of the specifics of your project), but, unless your end-users need the application to be based on several different platforms, I would have thought you'll be spared a lot of headaches by picking one platform and sticking to it.

    If the cost of using Oracle from the outset is a limiting factor, perhaps one of the open-source db platforms would provide what you need - I'm thinking particularly of Postgres as I have most experience with it.
      SQLite is much easier to just start working with. I can prototype all I want and it's my own private db. I can run it on my laptop. For Oracle I need to have to ration my usage of tablespace, servers, client installation: too much bureaucracy. The deployment environment does have access to Oracle I can piggyback on if I must. Installing other databases may be tricky, but SQLite is so hassle-free to turn out to be fine.

      The database is not a huge part of this project, anyway. I was hoping not to have many issues with it (I still do).