H5.Close causing problems

I have a C#.NET app. that writes data to an H5 file. It works correctly except when the data source is another H5 file. In this case the save function must call the reading function to get the file data. Upon return the saving function call to H5G.create to get a group id throws an exception.

I think this is because the saving function must call H5.Open before calling the reading function, then the reading function calls H5.Open and H5.Close. Upon return the saving function doesn't have access to the H5 library since it was closed in the reading function. If I take out the call to H5.Close in the reading function, everything works OK, but I wouldn't think this is good policy since you're leaving resources open. Am I doing something wrong here?

Any help would be appreciated.

It's hard for me to follow your problem description.
How about a simple program that demonstrates the issue?

G.

ยทยทยท

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Darryl Bryk
Sent: Thursday, January 26, 2017 11:10 AM
To: hdf-forum@lists.hdfgroup.org
Subject: [Hdf-forum] H5.Close causing problems

I have a C#.NET app. that writes data to an H5 file. It works correctly except when the data source is another H5 file. In this case the save function must call the reading function to get the file data. Upon return the saving function call to H5G.create to get a group id throws an exception.

I think this is because the saving function must call H5.Open before calling the reading function, then the reading function calls H5.Open and H5.Close. Upon return the saving function doesn't have access to the H5 library since it was closed in the reading function. If I take out the call to H5.Close in the reading function, everything works OK, but I wouldn't think this is good policy since you're leaving resources open. Am I doing something wrong here?

Any help would be appreciated.