Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Try to delete one of the rows and save.
  • Restore the two rows to their original value and save.
  • Log out, close the browser, then log in again to edit the timesheet; it should retain its original entries because the duplicates were not saved.

 


Other possible causes of this error include:

  1. Swapping project or task entries on the timesheet.
  2. Modifying an assignment, which causes timesheet changes during re-rating (the re-rate can leave some time outside of an assignment, and thus can cause it to default to a new value for labor category).
  3. Modifying the list of master or project labor categories, such that the update results in a new first entry in the list.
    1. The first labor category in the list is sometimes chosen in situations where a labor category is required but none is provided on an assignment and there is no default labor category (or the default is not on the list of valid project labor categories).
    2. Modifying the list may change the labor category to be the same as another row on the timesheet, thus causing the duplicate. The default Labor Category changes + there is time using the current default value + the new default Labor Category is already on the timesheet = duplicate row error.
  4. Changing the Admin > Properties setting to hide labor category on the timesheet, after two rows with different labor categories have already been saved.
    1. In these cases, the next time the timesheet is saved (and the system attempts to re-rate the entries on the timesheet) the labor category defaulting logic kicks in and both rows may now pick up the current labor category (from the assignment or default labor category).
    2. The key here is that when the labor category is shown on the timesheet, the system requires that one be selected instead of attempting to default a value. However, when labor category is hidden on the timesheet, the system will attempt to derive a default value and then attempt to stamp multiple rows with the same labor category. 
  5. Updating time via a time import or an assignment import.
    1. For example, situations in which pre-populated holidays are set up and then timesheets with holiday rows in the file are imported.

 


Sample error:

SQL Exception – Cannot insert duplicate key row in object 'person_time_data' with unique index 'idx_person_time_data1'.

...

SQLException caught in com.unanet.servlet.ActionServlet.

 


Code Block
java.sql.SQLException: Cannot insert duplicate key row in object 'person_time_data' with unique index 'idx_person_time_data1'.
           at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
           at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
           at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
           at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
           at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
           at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
           at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:505)
           at com.unanet.data.factory.TimeslipFactory.update(TimeslipFactory.java:649)
           at com.unanet.data.factory.TimeslipFactory.updateTimeslips(TimeslipFactory.java:1123)
           at com.unanet.data.factory.TimeslipFactory.updateOverrides(TimeslipFactory.java:1092)
           at com.unanet.data.factory.ProjectAssignmentFactory.update(ProjectAssignmentFactory.java:812)
           at com.unanet.data.factory.ProjectAssignmentFactory.save(ProjectAssignmentFactory.java:632)
           at com.unanet.page.projects.AssignmentSaveAction.service(AssignmentSaveAction.java:96)
           at com.unanet.page.Action.service(Action.java:300)
           at com.unanet.servlet.ActionServlet.doService(ActionServlet.java:139)
           at com.unanet.servlet.ActionServlet.doPost(ActionServlet.java:25)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
           at com.unanet.servlet.GzipFilter.doFilter(GzipFilter.java:44)
           at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
           at com.unanet.servlet.AccessLogFilter.doFilter(AccessLogFilter.java:82)
           at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
           at jrun.servlet.FilterChain.service(FilterChain.java:101)
           at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
           at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
           at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
           at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
           at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
           at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
           at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
           at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
           at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)