Re: [sqlite] Novice SQLite user

2010-05-26 Thread Simon Slavin

On 27 May 2010, at 2:15am, jdee5 wrote:

> hanks for your reply.  I have read through the link you suggested, very
> helpful...if I may ask another question concerning this.  Say on my
> application I have 2 users reading some of the database contents at the same
> time and they both log something in my application at the same time.

By 'log something' I assume you mean they are making changes to the same 
database they are both reading.

> For
> example say they want to both review different customer accounts and add a
> payment to the different customer accounts.  Would there be a delay with
> both of those when using SQLite, if so would it be significant?  

This is impossible to say because it depends on your network setup and how your 
application works, but purely as a guess, one user would see no delay at all 
and the other would see one of less than half a second.

> Can I use SQLite this way have my application stored on the server and allow
> users on a LAN/peer to peer have the ability to open my app and write to it
> at the same time?

SQLite does not care (or even know) where your application is stored.  It does 
care where the file that holds the database is stored (the one you called in 
your '_open' command) and needs to deal correctly with whatever networking (p2p 
is fine) you are using.  I would guess you are intending to write a Windows 
application so you need to be sure that your Windows network resource supports 
file locking correctly.

> does this type of multi user access often corrupt the
> database?

The page I pointed to has a section called something like 'How to corrupt your 
database'.  Don't do those things.  If you do manage to find a bug that hasn't 
been fixed yet (unlikely but not impossible), please tell us because the clever 
people here will pounce on it and fix it.

> If my database does become corrupt how can I repair it.

One common way is to use the sqlite3 command-line program to dump your entire 
database as one big text file full of SQL commands, then to use those commands 
to create another database.  Sometimes corruption can be fixed just by remaking 
your indexes.  It depends what went wrong.

As a responsible supplier you will, of course, be making sure your customer 
knows to take backups of your database occasionally.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Novice SQLite user

2010-05-26 Thread jdee5

P-

The application I sell is quite small and simple embedded db seems easier to
deploy.  My current install takes just a few minutes and so it doesn't seem
like a good idea to have to have my customer have to configure a
client/server database I need something quick and simple.  I tried out MS
SQL express for myself and had to go in and configure TCP setting and other
settings which took quite a while.  My customers are not tech savvy.  My
application is cheap so using MySQL doesn't make sense (i do not make my app
open source so I have a fee if i use MySQL) I am not familiar with PostGres,
do they offer a version that is free to distribute?  Is their configuration
to the DBMS?

Thanks.



P Kishor-3 wrote:
> 
> On Wed, May 26, 2010 at 8:15 PM, jdee5  wrote:
>>
>>
>>
>> Thanks for your reply.  I have read through the link you suggested, very
>> helpful...if I may ask another question concerning this.  Say on my
>> application I have 2 users reading some of the database contents at the
>> same
>> time and they both log something in my application at the same time.  For
>> example say they want to both review different customer accounts and add
>> a
>> payment to the different customer accounts.  Would there be a delay with
>> both of those when using SQLite, if so would it be significant?
>>
>> Can I use SQLite this way have my application stored on the server and
>> allow
>> users on a LAN/peer to peer have the ability to open my app and write to
>> it
>> at the same time?  does this type of multi user access often corrupt the
>> database?  If my database does become corrupt how can I repair it.
>>
>> Sorry for the redudancy in the questions...like I said am new to SQL
>> (used
>> MS SQL a little) and really new to the idea of using an embedded database
>> engine.
> 
> 
> Why do you want to use an "embedded database engine" and want to have
> multiple concurrent users changing the db over a network? If you want
> to users to be able to change stuff at the same time from different
> locations, use a true client/server db such as Postgres or MySQL.
> 
> If you have only a few users who will be changing the data, you could
> create a SQLite-powered web app, but there could be potential
> instances of lockouts. If you want to put your db on a LAN (shared
> disk), and have remote users change it, there is likely a potential
> for db to be corrupted.
> 
> 
> 
>>
>> Thanks in advance for information
>>
>>
>>
>> Simon Slavin-3 wrote:
>>>
>>>
>>> On 26 May 2010, at 10:04pm, jdee5 wrote:
>>>
 I am looking for an SQL engine that is easy to install and sqlite seems
 like
 the right way to go.  I have an application (currently just for network
 use
 on a LAN) and I want to move to using SQL, my application is fairly
 small
 and simple and I like the idea of embedding SQL and using SQLite so my
 end
 user doesn't notice any difference from my current
 application...however,
 more than 1 person may want to access the db at a time does SQLite
 allow
 for
 this?
>>>
>>> Yes.  SQLite supports locking for multi-user and multi-process access.
>>>  It
>>> is unusual in that it locks the entire database file rather than
>>> individual records, but the SQLite calls you make handle multi-user
>>> access
>>> correctly.  You /will/ have to make your application aware of how to
>>> handle the errors which arise if one user keeps the database locked so
>>> long that the other user can't access it.  I recommend you read this
>>> page
>>> (though you don't have to memorise it all):
>>>
>>> 
>>>
 Can it just sequentially record transactions as they are made even if
 made simultaneously... I have search all over and can't come to a clear
 conclusion, I am also very new to using SQL.
>>>
>>> Under most circumstances, even if two programs are entering transactions
>>> at the same time, SQLite will handle this without the programs having to
>>> be aware of it.  However, make sure you handle the SQLITE_BUSY and
>>> SQLITE_LOCKED errors correctly.  I hope someone can recommend a page
>>> which
>>> breaks down how to do this.
>>>
>>> Simon.
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Novice-SQLite-user-tp28686380p28688425.html
>> Sent from the SQLite mailing list archive at Nabble.com.
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> 
> 
> 
> -- 
> Puneet Kishor http://www.punkish.org
> Carbon Model http://carbonmodel.org
> Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
> Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
> Nelson Institute, UW-Madison http://www.

Re: [sqlite] Novice SQLite user

2010-05-26 Thread P Kishor
On Wed, May 26, 2010 at 8:15 PM, jdee5  wrote:
>
>
>
> Thanks for your reply.  I have read through the link you suggested, very
> helpful...if I may ask another question concerning this.  Say on my
> application I have 2 users reading some of the database contents at the same
> time and they both log something in my application at the same time.  For
> example say they want to both review different customer accounts and add a
> payment to the different customer accounts.  Would there be a delay with
> both of those when using SQLite, if so would it be significant?
>
> Can I use SQLite this way have my application stored on the server and allow
> users on a LAN/peer to peer have the ability to open my app and write to it
> at the same time?  does this type of multi user access often corrupt the
> database?  If my database does become corrupt how can I repair it.
>
> Sorry for the redudancy in the questions...like I said am new to SQL (used
> MS SQL a little) and really new to the idea of using an embedded database
> engine.


Why do you want to use an "embedded database engine" and want to have
multiple concurrent users changing the db over a network? If you want
to users to be able to change stuff at the same time from different
locations, use a true client/server db such as Postgres or MySQL.

If you have only a few users who will be changing the data, you could
create a SQLite-powered web app, but there could be potential
instances of lockouts. If you want to put your db on a LAN (shared
disk), and have remote users change it, there is likely a potential
for db to be corrupted.



>
> Thanks in advance for information
>
>
>
> Simon Slavin-3 wrote:
>>
>>
>> On 26 May 2010, at 10:04pm, jdee5 wrote:
>>
>>> I am looking for an SQL engine that is easy to install and sqlite seems
>>> like
>>> the right way to go.  I have an application (currently just for network
>>> use
>>> on a LAN) and I want to move to using SQL, my application is fairly small
>>> and simple and I like the idea of embedding SQL and using SQLite so my
>>> end
>>> user doesn't notice any difference from my current application...however,
>>> more than 1 person may want to access the db at a time does SQLite allow
>>> for
>>> this?
>>
>> Yes.  SQLite supports locking for multi-user and multi-process access.  It
>> is unusual in that it locks the entire database file rather than
>> individual records, but the SQLite calls you make handle multi-user access
>> correctly.  You /will/ have to make your application aware of how to
>> handle the errors which arise if one user keeps the database locked so
>> long that the other user can't access it.  I recommend you read this page
>> (though you don't have to memorise it all):
>>
>> 
>>
>>> Can it just sequentially record transactions as they are made even if
>>> made simultaneously... I have search all over and can't come to a clear
>>> conclusion, I am also very new to using SQL.
>>
>> Under most circumstances, even if two programs are entering transactions
>> at the same time, SQLite will handle this without the programs having to
>> be aware of it.  However, make sure you handle the SQLITE_BUSY and
>> SQLITE_LOCKED errors correctly.  I hope someone can recommend a page which
>> breaks down how to do this.
>>
>> Simon.
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/Novice-SQLite-user-tp28686380p28688425.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Novice SQLite user

2010-05-26 Thread jdee5



Thanks for your reply.  I have read through the link you suggested, very
helpful...if I may ask another question concerning this.  Say on my
application I have 2 users reading some of the database contents at the same
time and they both log something in my application at the same time.  For
example say they want to both review different customer accounts and add a
payment to the different customer accounts.  Would there be a delay with
both of those when using SQLite, if so would it be significant?  

Can I use SQLite this way have my application stored on the server and allow
users on a LAN/peer to peer have the ability to open my app and write to it
at the same time?  does this type of multi user access often corrupt the
database?  If my database does become corrupt how can I repair it.

Sorry for the redudancy in the questions...like I said am new to SQL (used
MS SQL a little) and really new to the idea of using an embedded database
engine.

Thanks in advance for information



Simon Slavin-3 wrote:
> 
> 
> On 26 May 2010, at 10:04pm, jdee5 wrote:
> 
>> I am looking for an SQL engine that is easy to install and sqlite seems
>> like
>> the right way to go.  I have an application (currently just for network
>> use
>> on a LAN) and I want to move to using SQL, my application is fairly small
>> and simple and I like the idea of embedding SQL and using SQLite so my
>> end
>> user doesn't notice any difference from my current application...however,
>> more than 1 person may want to access the db at a time does SQLite allow
>> for
>> this?
> 
> Yes.  SQLite supports locking for multi-user and multi-process access.  It
> is unusual in that it locks the entire database file rather than
> individual records, but the SQLite calls you make handle multi-user access
> correctly.  You /will/ have to make your application aware of how to
> handle the errors which arise if one user keeps the database locked so
> long that the other user can't access it.  I recommend you read this page
> (though you don't have to memorise it all):
> 
> 
> 
>> Can it just sequentially record transactions as they are made even if
>> made simultaneously... I have search all over and can't come to a clear
>> conclusion, I am also very new to using SQL.
> 
> Under most circumstances, even if two programs are entering transactions
> at the same time, SQLite will handle this without the programs having to
> be aware of it.  However, make sure you handle the SQLITE_BUSY and
> SQLITE_LOCKED errors correctly.  I hope someone can recommend a page which
> breaks down how to do this.
> 
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Novice-SQLite-user-tp28686380p28688425.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Novice SQLite user

2010-05-26 Thread Simon Slavin

On 26 May 2010, at 10:04pm, jdee5 wrote:

> I am looking for an SQL engine that is easy to install and sqlite seems like
> the right way to go.  I have an application (currently just for network use
> on a LAN) and I want to move to using SQL, my application is fairly small
> and simple and I like the idea of embedding SQL and using SQLite so my end
> user doesn't notice any difference from my current application...however,
> more than 1 person may want to access the db at a time does SQLite allow for
> this?

Yes.  SQLite supports locking for multi-user and multi-process access.  It is 
unusual in that it locks the entire database file rather than individual 
records, but the SQLite calls you make handle multi-user access correctly.  You 
/will/ have to make your application aware of how to handle the errors which 
arise if one user keeps the database locked so long that the other user can't 
access it.  I recommend you read this page (though you don't have to memorise 
it all):



> Can it just sequentially record transactions as they are made even if
> made simultaneously... I have search all over and can't come to a clear
> conclusion, I am also very new to using SQL.

Under most circumstances, even if two programs are entering transactions at the 
same time, SQLite will handle this without the programs having to be aware of 
it.  However, make sure you handle the SQLITE_BUSY and SQLITE_LOCKED errors 
correctly.  I hope someone can recommend a page which breaks down how to do 
this.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Novice SQLite user

2010-05-26 Thread jdee5

I am looking for an SQL engine that is easy to install and sqlite seems like
the right way to go.  I have an application (currently just for network use
on a LAN) and I want to move to using SQL, my application is fairly small
and simple and I like the idea of embedding SQL and using SQLite so my end
user doesn't notice any difference from my current application...however,
more than 1 person may want to access the db at a time does SQLite allow for
this?  Can it just sequentially record transactions as they are made even if
made simultaneously... I have search all over and can't come to a clear
conclusion, I am also very new to using SQL.
-- 
View this message in context: 
http://old.nabble.com/Novice-SQLite-user-tp28686380p28686380.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users