I have next code:
PhotoFactory factory = PhotoFactory.getFactory (PhotoResource.PICASA);
PhotoSession session = factory.openSession (login, password);
PhotoAlbum album = factory.createAlbum ();
Photo photo = factory.createPhoto ();
album.addPhoto (photo);
if (session.canUpload ()) {
session.uploadAlbum (album);
}
session.close ();
I'm not sure that I've chosen correct name. It's not so important but I'm just curious what had you chosen in my case. Another version is manager:
PhotoManager manager = PhotoManager.getManager (PhotoResource.PICASA);
PhotoSession session = manager.openSession (login, password);
PhotoAlbum album = manager.createAlbum ();
Photo photo = manager.createPhoto ();
album.addPhoto (photo);
if (session.canUpload ()) {
session.uploadAlbum (album);
}
session.close ();
UPD: I've just found next example at hibernate javadocs:
Session sess = factory.openSession();
Transaction tx;
try {
tx = sess.beginTransaction();
//do some work
...
tx.commit();
}
Is that a naming mistake?