Check out this discussion thread on "the Server Side":
http://theserverside.com/patterns/thread.jsp?thread_id=4228
it contains a boat-load of information/ideas on how to create unique id's
for EJBs. Hope it helps!
- Frank
-Original Message-
From: Cumps Jef [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 1:37 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] primary key problem
Hi all,
i have a problem and some solutions, but i don't know which one's the best:
I have some entity beans working with MS SQL Server. When i undeploy my
application the tables are not destoyed and i don't want them to. The
problem is that i want to work with an int as Primary Key for those entity
beans. That int should be auto-increasing if you get what i mean. Every new
row in the database should get the next number.
I cannot work with a static int in my bean because when i re-deploy it, it
will restart counting from 0 and that row would already exist.
I could make a database acces in every create method to check which the last
PK in the database was, but i've got the feeling there's a better solution.
Is there a standard way to work here, or not. What would be the best
solution ?? Any possibility to make SQL Server do the job itself ??
any help, tips or examples would be really appreciated.
thanx in advance,
jef
>
___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user
___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user