Opened 16 years ago

Closed 15 years ago

#354 closed defect (fixed)

PostGIS Defect : cursor name conflict make provider crash

Reported by: bscott Owned by:
Priority: blocker Milestone: 3.4.0
Component: PostGIS Provider Version: 3.2.0
Severity: 1 Keywords:
Cc: External ID:

Description

the CreateCursor function uses a fixed string + the current date and time for a unique cursor name. I have found many cases where 2 or more cursor are created in the same second, so the provider crashes with the "Cursor already exist" PostGIS message.

Adding a random number at the end of the unique cursor name calculation should resolve this issue.

Change History (7)

comment:1 by jbirch, 16 years ago

This problem was also addressed in #116 by adding more granularity to the time measure. Did this get reverted when the dependancy on the boost time library was removed, or are you seeing conflicts at the microsecond level? Regardless, the potential for conflict still exists regardless of the time interval used.

What are you planning to use as the random seed? Is there some kind of identifier available that is already unique for each query?

comment:2 by jbirch, 16 years ago

Wow, I really am a dork. Can't believe I managed to use regardless twice in the same sentence.

in reply to:  2 comment:3 by bscott, 16 years ago

Before the boostdatetime dependency removal we had a millisecond based cursor name, i've changed it for a similar algo having the date + hour + minute + second + clock() where clock is millisecond based. But we still have cursor name conflict. I suggest this date + hour + minute + second + clock() + rand() without any seeds. The only way of having the same cursor name is to start 2 mapguide server and initialise there FIRST connection to PostGIS at the same millisecond.

It's still not 100% safe but it's really safer , dividing the probalitity of a clash by RAND_MAX(32767)

comment:4 by bscott, 15 years ago

Resolution: fixed
Status: newclosed

comment:5 by mloskot, 15 years ago

Resolution: fixed
Status: closedreopened

comment:6 by mloskot, 15 years ago

Owner: mloskot removed
Status: reopenednew

comment:7 by mloskot, 15 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.