For committing a criminal sex act with a child, James Hockenbury of Guilderland will spend 15 years in state prison, not the 10 agreed upon by his attorney and the Albany County District Attorney’s Office, Judge Peter A. Lynch decided Wednesday morning.