hugoloza / gwt-mobile-webkit

Automatically exported from code.google.com/p/gwt-mobile-webkit
2 stars 0 forks source link

Patch for /trunk/gwt-mobile-webkit/database/database/src/com/google/code/gwt/database/client/service/impl/BaseDataService.java #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The static field *database* should be non-static; otherwise only the handle to 
the first database created is returned when using the generators.

Original issue reported on code.google.com by olaf.tie...@googlemail.com on 21 Jul 2011 at 4:30

Attachments:

GoogleCodeExporter commented 9 years ago
Good catch, thanks!

This is a programming error, the static database field should actually be on 
the generated DataService class.

Your patch solves the problem, no doubt about that, but it will create a new 
reference to the same database whenever a new instance of the generated 
DataService is created. When using a 'naked' Database, this could give some 
problems. In other words, use only a single instance of your DataService class 
- see DatabaseApi#One_Instance for details.

Original comment by bguijt on 21 Jul 2011 at 10:35