server side
----------
at server side i loaded my data with person and also configured with my
database..
cache.loadCache(null,100_000);
cache.size();// It returns length of cache.
client side
----------
public static void main (String args[])
{
Ignition.setClientMode(true);
Ignite ignite=Ignition.start("ignite-example.xml");
IgniteCache<String, SessionManagementVO> cache =
ignite.getOrCreateCache("CacheName");
System.out.println(cache.size());// it also succesfully returns
same
length
executeTransaction(cache);// but her it shows error
}
private static void executeTransaction(IgniteCache<String, Person>
cache) {
try (Transaction tx = Ignition.ignite().transactions().txStart()) {
Person val = cache.get(2);// here it show error.
System.out.println("Read value: " + val);
tx.commit();
}
}
the error is:
Exception in thread "main" org.hibernate.LazyInitializationException: could
not initialize proxy - no Session
at
org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:186)
at
org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)
at
org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:124)
at
org.hibernate.collection.internal.PersistentMap.toString(PersistentMap.java:270)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at com.tcs.utility.vo.DeviceVO.toString(DeviceVO.java:139)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at com.tcs.vo.SessionManagementVO.toString(SessionManagementVO.java:171)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at com.demo.ClientSide.executeTransaction(ClientSide.java:29)
at com.demo.ClientSide.main(ClientSide.java:23)
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/At-client-side-unable-to-use-excute-transaction-tp4447.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.