M
Mullin
I need to generate a unique no. in the format like
yyyymmddxxxxxx (xxxxxx 6-digitl running number)
I think of create a table with two columns
date value
20050405 120
20050406 99
Everytime, the application will increase the value+1 based on the same
date. If not date found, create one record and value = 1
The problem is that since there's no transaction at mysql 4.1.x that
even the application
1. insert value
2. max() to get
max() may not get the value just insert BECAUSE there may be
MULTI-threads/users
How can implement so with Java and mysql?
yyyymmddxxxxxx (xxxxxx 6-digitl running number)
I think of create a table with two columns
date value
20050405 120
20050406 99
Everytime, the application will increase the value+1 based on the same
date. If not date found, create one record and value = 1
The problem is that since there's no transaction at mysql 4.1.x that
even the application
1. insert value
2. max() to get
max() may not get the value just insert BECAUSE there may be
MULTI-threads/users
How can implement so with Java and mysql?