Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / August 2007

Tip: Looking for answers? Try searching our database.

record numbers

Thread view: 
Mario - 30 Aug 2007 11:39 GMT
Maybe my question is stupid and wrong but I hope that you will understand.
So, image that you need to create web application which will used by many
peoples in one LAN. They processing some documents and every person has the
particular number of documents in particular order (1. person has documents
from 1 to 100, second from 101 to 200 etc), which process with the
particular number (first document -> number 1 in a database). If they all
work in a same time, what is the easiest and the most safety way to manage
that? Adding number manually is the logical solution but if 2 person put the
same number, can they freeze the database or databases are imune on that ?
Roedy Green - 30 Aug 2007 12:07 GMT
>Maybe my question is stupid and wrong but I hope that you will understand.
>So, image that you need to create web application which will used by many
[quoted text clipped - 5 lines]
>that? Adding number manually is the logical solution but if 2 person put the
>same number, can they freeze the database or databases are imune on that ?

You would not work that way in real life because guaranteed somebody
will need more than 100 documents.  There are basically three ways to
deal with documents.

1. put the documents themselves into the SQL database.

2. put just an index of the documents, and perhaps keywords and/or
text but not formatting in the database, and leave the documents as
indpedent files.  The server can serve the documents given an URL.

see http://mindprod.com/jgloss/sql.html

3. Buy a turn-key document management system that likely uses a
proprietary database/indexing scheme.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

RedGrittyBrick - 30 Aug 2007 14:46 GMT
> Maybe my question is stupid and wrong but I hope that you will understand.
> So, image that you need to create web application which will used by many
[quoted text clipped - 5 lines]
> that? Adding number manually is the logical solution but if 2 person put the
> same number, can they freeze the database or databases are imune on that ?

Many databases allow you to define a column in a table as being
"serial". These have their value allocated by the DBMS when you insert a
record and are guaranteed to be unique.

Most databases allow you to define that a certain column in a table be
"unique". The database will report an error if a second person tries to
add a record with the column set to a value that has been already used.

As Roedy suggested, it's almost certainly not a good idea to
pre-allocate a fixed range of document numbers to each user. I'd include
the user_ID in the "document" table as (say) "author_ID".
Lew - 30 Aug 2007 15:04 GMT
> Many databases allow you to define a column in a table as being
> "serial". These have their value allocated by the DBMS when you insert a
[quoted text clipped - 3 lines]
> "unique". The database will report an error if a second person tries to
> add a record with the column set to a value that has been already used.

If a so-called "database" does not support this feature it isn't really a
database.  If it doesn't support multi-column keys then it isn't really a
database.

> As Roedy suggested, it's almost certainly not a good idea to
> pre-allocate a fixed range of document numbers to each user. I'd include
> the user_ID in the "document" table as (say) "author_ID".

Then a combination of "author[ID]" and the author's own assigned number or
title is unique, and can be used to key the table.

Signature

Lew

Sabine Dinis Blochberger - 31 Aug 2007 09:15 GMT
> Maybe my question is stupid and wrong but I hope that you will understand.
> So, image that you need to create web application which will used by many
[quoted text clipped - 5 lines]
> that? Adding number manually is the logical solution but if 2 person put the
> same number, can they freeze the database or databases are imune on that ?

That sounds to me (almost) like a version control system, where you
check a document out and no-one else can edit it for the time being. Or
maybe you need some sort of group ware, that does the same thing.
Signature

Sabine Dinis Blochberger

Op3racional
www.op3racional.eu



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.