Josh HartnettPearl Harbor actor Josh Hartnett - who is currently starring in a London theatre production of Rain Man - was caught having sex in the SoHo hotel library by CCTV cameras.

Josh Hartnett was caught on CCTV having sex in a hotel library.

The 30 Days of Night actor - who is currently starring in a London theatre production of Rain Man - was unaware he was being watched by hotel staff as he romped with a mystery woman.

Josh, 30, entered the hotel quiet late with his soon to be sex tape leading lady and headed for the library, though his pursuit was anything but intellectual.

Trying to be discreet, the star drew all the curtains in the wing of the Soho hotel, but failed to spot the surveillance cameras filming his every move.

A source told Britain's Daily Mirror newspaper: "Josh and the girl were getting pretty hot and heavy. Their every spit and cough was recorded and cringing hotel workers saw all of Josh's X-rated moves. No one quite knew where to look and there was a very awkward silence. Josh didn't seem bothered that the library wasn't locked and anyone could just burst in. He just kind of went for it."

After the romp, the 30-year-old star was "asked to take his personal business elsewhere" in the future by hotel workers.

The source added: "He has been very well behaved since."

David Duchovny & Tea Leoni David Duchovny, who plays a novelist whose libido often leads him into trouble on "Californication," is having trouble with sex in real life.

The star of the big-screen "The X-Files: I Want to Believe" has entered a rehabilitation center for sex addiction, People reported.

I have voluntarily entered a facility for the treatment of sex addiction," he told the magazine. "I ask for respect and privacy for my wife and children as we deal with this situation as a family."

David Duchovny & Tea Leoni"Duchovny, 48, is married to actress Tea Leoni. They live in Malibu, Calif., with their two children, daughter Madelaine, 9, and son Kyd, 6.

On Showtime's "Californication," Duchovny plays the troubled Hank Moody, a role for which he won a Golden Globe.