Question: I have an entity that has a collection in it. The collection is a OneToMany unidirectional relationship storing who viewed a particular file. The problem I am having is that after I load the entity and try to update the collection, I don't get any errors, but the collection is never updated:

Entity:

```
@OneToMany(cascade = CascadeType.PERSIST)
@JoinTable
protected List<User> users;

```

File Servlet

```
@In
private EntityQuery<File> File_findById;

...

File file = File_findById(fileId);
file.getUsers().add(user);
session.update(file);

```

Even though I call `session.update(file)` and I see stuff in hibernate logs, I don't see anything in the database indicating that it was saved.

Walter

Answer: 
A few things:

1. Check to see if your Read call is blocking. If so, you might not be able to call Write while the Read is blocking waiting for a response. Your API documentation may have more details on this.
2. Some APIs do not support multiple threads very well, even when synchronizing access. If that's the case here, you can use a design where you delegate your Write commands to your comm thread. When I've used this pattern in the past, I typically queue up some sort of Command class containing the information I wish to write, and either use a threading Signal class to allow my calling 'command' methods to block or provide some sort of asynchronous notification.
I've found more detailed API documentation. Indeed the ftdiDevice.read function is blocking unless you set the readTimeout value other then 0. Setting this timeout value solved the problem.

Thanks for your quick response.  

Regards